无法将LINQ添加到ASP。网网页

时间:2021-11-11 07:42:12

I've got a simple ASP.NET website, but I can't get it to work. The server is running IIS 7.5 with .NET 4.0 installed, and I've got complete access, and I'm using VS2010 to generate an ASP.NET 4 website. But VS automatically generates code-behind files with using System.Linq; in them. This wouldn't be a problem for me except it doesn't seem to reference Linq by default. I added in the IIS Manager/site/.NET Compilation/Assemblies list the System.Data.Linq assembly, and I added a reference to it in the web config, but it's still complaining that System.Linq does not exist.

我有一个简单的ASP。NET网站,但是我不能让它工作。服务器运行的是IIS 7.5,安装了。net 4.0,我有完整的访问权限,我正在使用VS2010来生成ASP。净4网站。但是VS自动生成使用System.Linq文件的代码。在他们。这对我来说不是一个问题,除非它在默认情况下不引用Linq。我添加了IIS管理器/站点/。NET编译/程序集列表。Linq程序集,我在web config中添加了一个引用,但是它仍然在抱怨系统。Linq是不存在的。

The website works fine on my home machine where I'm developing it with VS2010 installed.

这个网站在我的家用机器上运行良好,我在那里安装了VS2010。

What's the problem?

是什么问题?

1 个解决方案

#1


1  

The default application pool is 2.0, rather than 4.0 (unhelpful default), which also explains why VS2010 ran it fine- it knew that it was a 4.0 application. Once I changed this, everything is working smoothly.

默认的应用程序池是2.0,而不是4.0(没有帮助的默认值),这也解释了为什么VS2010运行的很好——它知道它是一个4.0的应用程序。一旦我改变了这一切,一切都很顺利。

#1


1  

The default application pool is 2.0, rather than 4.0 (unhelpful default), which also explains why VS2010 ran it fine- it knew that it was a 4.0 application. Once I changed this, everything is working smoothly.

默认的应用程序池是2.0,而不是4.0(没有帮助的默认值),这也解释了为什么VS2010运行的很好——它知道它是一个4.0的应用程序。一旦我改变了这一切,一切都很顺利。