0

我使用 .NET 3.5 服务开发了一个 WCF 来将一些数据导入到 Internet。

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

无法加载文件或程序集“系统,版本=4.0.0.0,文化=中性,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

有关如何解决该问题的任何线索?

4

2 回答 2

2

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

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

于 2012-05-08T16:06:54.840 回答
0

FileNotFoundException:无法加载文件或程序集'系统,版本 = 4.0.0.0

明确声明您引用 .NET 4.0

于 2012-05-08T20:51:28.263 回答