0
votes

I made a great WCF service in my dev environment, then when I pushed it up to production I got various errors saying "This collection already contains an address with scheme http..."

So, I created a Custom ServiceHostFactory class for my service.

Now when I upload it I get:

The CLR Type 'WCFServices.MultipleHostFactory' could not be loaded during service compilation. Verify that this type is either defined in a source file located in the application's \App_Code directory, contained in a compiled assembly located in the application's \bin directory, or present in an assembly installed in the Global Assembly Cache. Note that the type name is case-sensitive and that the directories such as \App_Code and \bin must be located in the application's root directory and cannot be nested in subdirectories.

I checked the GAC and my assembly is indeed there.

Can anyone explain why this error is occuring?

Again, I am using .NET 3.5 on Sharepoint 2010

2
Did you reference your factory type using the full assembly-qualified name? Can you post the contents of your svc file?Nigel Whatling
Yes. I did. <%@ ServiceHost Debug="true" Language="C#" Service="WCFServices.MyServices, $SharePoint.Project.AssemblyFullName$" Factory="WCFServices.MultipleHostFactory" CodeBehind="MyServices.cs" %>Kris Blair

2 Answers

0
votes

Is it "WCFServices.MultipleHostFactory" or "WCFServices.MultipleHostsFactory"? If its the first, thats why because that namespace does not match that you said in your question.

0
votes

It turns out that I was able to remove one of the bindings from the application host configuration file. After talking with the administrator, I found that he had two bindings for port 80. One was IP:80:[DNS name] and the other was :80:

We agreed to get rid of the :80: binding and the WCF service was able to deploy to SP.

If anyone ever runs into that CLR loading issue, please post with a solution. I still don't have a good explanation for that problem.