0

I have seen many answers to similar questions, but have an additional question

I developed a web site in Visual Studio 2008. Working well on development server. When I tried to transfer it to client's server, it is giving the error: Could not load file or assembly 'System.Core, Version=3.5.0.0'

Noticed that client's server has version 2.0.0.0 and 4.0.0.0. Changing my development environment to VS2010 might work, but is there any simpler solution (something like modifying web.config file)?

In short: If I develop with 3.5.0.0, can the site be loaded to 2.0.0.0 OR 4.0.0.0 by modifying the web.config file? (It is logical that some compatibility/flexibility will be there between development and deployment set up I hope!). My web site is pretty simple, but have a MS SQL db interactions.

4

1 回答 1

0

当您从 IIS 设置中读取 v2.0 和 v4.0 时,这仅意味着机器上至少安装了 .NET 2.0 和 .NET 4.0,因此在 IIS 中注册了两个版本的 CLR。

但是,要运行基于 .NET 3.5 的 Web 应用程序,您需要在计算机上安装 .NET 3.5。尽管安装 .NET 3.5 会重用 CLR 2.0,但必须提供应用程序所需的 System.Core。

确保为 IIS 应用程序池选择 v2.0,以便 IIS 加载 CLR 2 并为您的应用程序自动初始化 .NET 3.5 所需的程序集。

于 2013-03-22T05:54:12.277 回答