BizTalk 2013 hosted WCF Service fails because it could not load Microsoft.BizTalk.Interop.SSOClient
I'm in the midst of migrating my customer from BizTalk 2009 to BizTalk 2013, migration being distinct from upgrading in that I'm installing BizTalk 2013 from scratch on newly built servers. Everything installed well, except when I tried to access any BizTalk generated WCF service, I would get an error. Browsing to the URL on the local machine I would get the following:
Could not load file or assembly 'Microsoft.BizTalk.Interop.SSOClient, Version=7.0.2300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Bing'ing this error led me to a few references that indicated that others were seeing this error, but not in exactly the same way that we were (for example, this blog had a great write-up however it referenced an upgrade from BizTalk 2010 to 2013 and wasn't directly applicable). After awhile I turned internally for help and soon figured out my issue: I had installed and configured my BizTalk and underlying components using a series of scripts, modified appropriately for the new environment. But what I'd missed was that in my IIS 7.5 setup scripts, the application pools that were being created were set to Classic and targeted the v2.0 Framework. BizTalk 2013 was built against the .NET 4.0 Framework, so the service could not find the correct assembly because it was looking for the assembly in the wrong place.
I switched the application pool to Integrated and targeted the v4.0 Framework. This cleared the initial error, but then I was receiving a new error from IIS that the svc handler was not correctly mapped. I then realized that I needed to run the "aspnet_regiis.exe -I" command against the correct version of aspnet_regiis (the v4.0 framework version). Once I had done this, the service page loaded correctly and all was well again.