简体   繁体   English

Sharepoint 2010中的WCF服务找不到我的自定义ServiceHostFactory类

[英]WCF Service in Sharepoint 2010 can't find my Custom ServiceHostFactory class

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..." 我在开发环境中提供了出色的WCF服务,然后将其推向生产环境时,出现了很多错误,提示“此集合已经包含一个使用方案http ...的地址”。

So, I created a Custom ServiceHostFactory class for my service. 因此,我为我的服务创建了一个Custom ServiceHostFactory类。

Now when I upload it I get: 现在,当我上传它时,我得到:

The CLR Type 'WCFServices.MultipleHostFactory' could not be loaded during service compilation. 在服务编译期间无法加载CLR类型'WCFServices.MultipleHostFactory'。 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. 验证此类型是在应用程序\\ App_Code目录中的源文件中定义,在应用程序\\ bin目录中的已编译程序集中包含的还是在全局程序集缓存中安装的程序集中存在。 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. 请注意,类型名称区分大小写,并且\\ App_Code和\\ bin等目录必须位于应用程序的根目录中,并且不能嵌套在子目录中。

I checked the GAC and my assembly is indeed there. 我检查了GAC,而我的程序集确实在那里。

Can anyone explain why this error is occuring? 谁能解释为什么会发生此错误?

Again, I am using .NET 3.5 on Sharepoint 2010 同样,我在Sharepoint 2010上使用.NET 3.5

Is it "WCFServices.MultipleHostFactory" or "WCFServices.MultipleHostsFactory"? 是“ WCFServices.MultipleHostFactory”还是“ WCFServices.MultipleHostsFactory”? If its the first, thats why because that namespace does not match that you said in your question. 如果是第一个,那就是为什么,因为该名称空间与您在问题中说的不匹配。

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: 与管理员交谈后,我发现他为端口80绑定了两个。一个是IP:80:[DNS名称],另一个是:80:

We agreed to get rid of the :80: binding and the WCF service was able to deploy to SP. 我们同意摆脱:80:绑定,并且WCF服务能够部署到SP。

If anyone ever runs into that CLR loading issue, please post with a solution. 如果有人遇到了CLR加载问题,请发布解决方案。 I still don't have a good explanation for that problem. 对于这个问题,我仍然没有很好的解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM