WCF Service in Visual Studio "locking up" for a minute

When you build a WCF service using Visual Studio 2008 using the WCF Service Library project template, Visual Studio automatically hosts the service library using the WcfSvcHost.exe application. However, when you're simply hosting this service in another service host (like IIS) you don't need this WcfSvcHost.

To make this even more annoying, if the service configuration is incorrect (why would you want to fix something you're not using anyway???) you will see this warning when starting to debug "The target assembly contains no service types. etc...":

 image

This is actually caused by the WcfSvcHost searching your assembly for service types...

There is an easy way to get rid of this, simply delete the app.config file in the service library. You don't need config files in service libraries anyway. Beware, there might be useful configuration information like connection strings, so copy these over to your host's config before deleting.

I tried simply deleting the service configuration from the config file, but the tool still insists in you configuring the service, so this doesn't help. If you still need a .config file in your service library, avoid the WCF Service Library template, use the normal library project instead and add references to System.ServiceModel and System.Runtime.Serialization.

Or you can try to delete the following line from your project:

<ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

This deletes the WcfSvcHost from starting.