I’m trying to put together a Windows Service, which hosts a WCF service.
My project structure is as follows:
- Service
- Service.Contracts
- Service.Host
- Service.Setup
The Service.Host project contains the ProjectInstaller, the Service.Setup project the WindowsInstaller.
Now, everything builds and installs just fine, but when I try to start the service, it immediately stops running with the following message in my event log:
Service cannot be started. System.TypeLoadException: Could not load type 'Service' from
assembly 'Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
at Host.Service.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
When I check the output folder of my setup project I can see both the Service.dll as well as the Service.Contracts.dll… This puts me off guard. How do I debug this when everything builds ok? What to do?
Fixed: stupid error with namespace declarations.