tags:

views:

67

answers:

1

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
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
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
See additional assembly-qualification recommendation edit above.
nitzmahone
Added the qualifier assembly to the web.config and it didn't help.
suedeuno