posted on October 17, 2006 10:28 AM by Kurt
Can't publish orchestration as web service even though ports are Public
"But I swear my Two Way Ports are Public scoped"
Publishing an Orchestration as a Web Service: it's a common thing. You create an orchestration; create a send-receive logical port; and try to expose via web-service. Ah, but you forgot to make it Public scoped - by default it's Internal - no biggie. Intuitively, per the error message you get ["There are no orchestrations with public receive ports in this BizTalk assembly. Click back and specify a BizTalk assembly containing orchestrations with public receive ports."], you change the scope to Public and re-try the Publish Orchestration as Web Service.
But you still get the message that it's not public.
I have run into this a number of times, and I should be ashamed because I have listened to erroneous blog posts that tell you to re-write your project. Normally, my projects are small enough that it doesn't matter.
But now, here's the canonical word on the subject - it comes via Marty Wazsnicky, Regional Program Manager at Microsoft and head of the Virtual TS program (which I am a part of). Mix equal parts caffeine and BizTalk and you have Marty. It's ashame he doesn't blog more often, because he's full of good information.
Anyway, to solve your problem Restart the BTSNTSVC.exe. As Marty explains it, BizTalk 2006 uses .NET 2.0 caching for inspection of the Assembly that contains your newly public ports. Thus, it never really inspects your new assembly and just relies on the old assembly (with Internal port scopes). This is a dependency on the .NET CLR 2.0, so that's why this is a problem with BizTalk 2006 and not BizTalk 2004.
To sum up: Restart the service, the caching goes away and you can now create your service.