How to share code/ assemblies
-
Monday, February 20, 2012 11:21 AM
Hello folks,
we are developing multitenant apps, until now WCF services were self hosted in a single Windows Service whereby we are using WCF Routing to provide different endPoints to services. Now we rethink our hosting model and we are looking to AppFabric.
Our WCF services could be structured like this:
The question is how we share the code/ assemblies for services.
I searched in web and I come across different approaches: from using GAC to assembly loading/resolving but there is also an another option possible: using for all TaxServices the same virtual directory. E.g. virtual directory for Tenant001 could be C:\temp\Tenants\Tenant001, for all TaxServices it could be C:\temp\Services\TaxService. Or we could go further and place all code of the same version in the only one directory, e.g. C:\temp\Services, to
build WCF Endpoints we would using ServiceHostFactory, that would construct a service host.Is it doable? What are cons and pros? Thanks
All Replies
-
Tuesday, February 21, 2012 12:22 PM
On http://social.msdn.microsoft.com/Forums/en/wcf/thread/7e8266cf-329f-41fc-b2c7-deb81ef081b4 I added some explanations
Thanks
-
Wednesday, July 25, 2012 12:47 PM
Independent of your hosting module a single service application may expose different endpoints for different contracts (or the same contract on different endpoints with a different underlying logic).
Your example does not look familiar to me. I myself am used to using C# and hosting as Windows Service or in IIS (with our without AppFabric).
To expose multiple endpoints I configure different services with different controllers each with their own base address.
Here is a sample for two endpoints, I hope it is of use<service
behaviorConfiguration="TSOrdersBehavior"
name="TSOrders.Implementation.OrderEntryController">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost/TSOrders/OrderEntry.svc"/>
</baseAddresses>
</host>
<endpoint
address="" binding="netTcpBinding" contract=" IOrderAcceptance"
bindingNamespace="urn:…." behaviorConfiguration="EntryDiscoveryEndpoint">
</endpoint>
</service>
<service
behaviorConfiguration="TSOrdersBehavior"
name="TSOrders.Implementation.OrderValidationController">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost/TSOrders/OrderValidation.svc"/>
</baseAddresses>
</host>
<endpoint
address="" binding="netTcpBinding" contract=" IOrderValidation"
bindingNamespace="urn:….." behaviorConfiguration="ValidationDiscoveryEndpoint">
</endpoint>
</service>- Edited by Nico de Bruin Wednesday, July 25, 2012 12:48 PM Typo's

