I guess you, like me, use the BtsWcfServicePublishing.exe to automate the deployment process for your wcf-hosting needs in BizTalk. If you don’t I think you should, as it saves you a lot of time. For one you don’t have to regenerate your endpoint information using the BtsWcfServicePublishingWizard (note: not the same program as the BtsWcfServicePublishing) and all it’s tedious steps every single time you update a service.

The thing is that when you use the BtsWcfServicePublishing.exe on a BizTalk-assembly built using BizTalk 2010 you get an error like this:

Error publishing WCF service.
Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\assembly\GAC_MSIL\' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

This is due to the fact that the BtsWcfServicePublishing tries to use version 2.0 of the .net framework. To make it work on BizTalk 2010 assemblies add the following info in the configuration file (just under the configuration-tag.

<startup>
   <supportedRuntime version="v4.0" />
</startup>

Just run it again and you’ll be happy as Larry.

Blog Post by: Mikael Sand