AnsweredAssumed Answered

Use ArcEngine in the context of a Windows Service

Question asked by adespaignet63 on Mar 2, 2016

Does anyone know if it is possible to run ArcEngine in the context of a Windows Service?

 

I am using RuntimeManager.Bind(ProductCode.Engine)

and

                if (m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB },

                                                                new esriLicenseExtensionCode[] { }))

 

from "generated" LicenseInitializer and the call to InitializeApplication never seems to return.

 

Service Control Manager says the service failed to start in a timely fashion so the service does not start.

I tried beefing up the service start delay in the registry, No go.

 

I have Desktop Advanced concurrent license as well as ArcEngine developer license on the machine I am testing.

 

Why do I want to do this in a Windows Service in the first place?

I am doing data synchronization and using ExportReplicaDataChanges of IGeoDataServer2 to distribute GIS data changes to client apps. This piece is meant to run on a server as a Windows Service.

 

Can this be done?

 

Everything runs fine as a console app but not as a service.

Should I do this using a console app fired off by Windows Scheduler instead?

 

Thanks

Outcomes