WCF服务托管在共享主机上

时间:2012-05-08 16:04:50

标签: .net wcf shared-hosting assembly-loading

我使用.NET 3.5服务开发了一个WCF,将一些数据导入互联网。

使用IIS Express,本地一切正常。当我将服务部署到共享主机并将我的浏览器指向服务地址时,我得到以下异常:

  
    

无法加载文件或程序集'System,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或其依赖项之一。系统找不到指定的文件。

  

我的环境配置为使用具有32位兼容性的.NET 3.5。

堆栈跟踪显示:

[FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.] System.ServiceModel.AsyncResult.End(IAsyncResult result) +11655726 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +275 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

关于如何解决这个问题的任何线索?

3 个答案:

答案 0 :(得分:2)

“我的环境配置为使用具有32位兼容性的.NET 3.5。”

你确定吗?看起来很像你的本地系统正在使用.net 4.0而你的主机只有3.5。

答案 1 :(得分:0)

  

FileNotFoundException:无法加载文件或程序集'System,Version = 4.0.0.0

明确声明您引用了.NET 4.0

答案 2 :(得分:0)

如果您看到错误消息,则似乎需要设置.net 4.0。请与您的托管服务商再次核实。

相关问题