I tried to use separate assemblies for the implementation, contract and WCF service library but starting the service in debug produced an error because it couldn't find the service/contract. If I move them into the same assembly it works. What is needed to wire up the WCF when it's in different assemblies?
+1
A:
Shouldn't be anything special to do - we've got hundreds of services running with contracts and impls in separate assemblies, and it works just fine. Are you self-hosting with ServiceHost or using IIS? If you're using IIS, make sure the host project has references to both assemblies so they all show up in the bin directory together. You may need to at least partially assembly-qualify the type name in the ServiceHost directive's Service attribute (ie, MyImplNamespace.MyImplTypeName,MyAssemblyName).
nitzmahone
2009-11-05 08:01:29
I am using a .svc file and local .net dev host. So are you saying I have to move the impl/contract assemblies to the .svc assembly post-build for this to work?
suedeuno
2009-11-05 13:00:00
Scratch the last question, yes I did have references to both assemblies in my host assembly. The error message is : The target assembly contains no service types. You may need to adjust the Code Access Security policy of this assembly.
suedeuno
2009-11-05 14:33:25
See additional assembly-qualification recommendation edit above.
nitzmahone
2009-11-05 14:55:13
Added the qualifier assembly to the web.config and it didn't help.
suedeuno
2009-11-05 17:01:11