我的服务器上有一个旧的 ASP.NET Web 应用程序,它是 2008 年在 Visual Studio 2008 中开发的。该服务器现在也安装了 .NET 4.0。当我尝试访问网络应用程序时,我得到:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1703: An assembly with the same identity 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' has already been imported. Try removing one of the duplicate references.
Source Error:
[No relevant source lines]
我可以做些什么来让它在不访问原始 Visual Studio 解决方案的情况下工作吗?我相信这与服务器上也安装了.NET 4.0有关。
最佳答案
1) 您是否检查过您的应用程序运行所在的应用程序池?它仍然是 .net 2.0 集成/经典,还是自动更改为 4.0?如果是这样,请尝试更改回 2.0。
2) 应用程序的 bin 文件夹中是否有 System.Web.Extensions.dll?如果是这样,请尝试重命名(类似 here 的情况)
3) 如果 1 不是一个选项并且 2 不是这种情况,那么您在应用程序的配置文件中是否有对 System.Web.Extensions 的显式引用?他们是否请求不同版本的文件?
关于asp.net - .NET 4.0 服务器上的旧 Web 应用程序停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9603675/