在.NET 4.0中的web.config编译错误 - 找不到的Linq [英] Compilation error in .NET 4.0 web.config - Linq not found
问题描述
我可以编译和Visual Studio 2010中的测试我的.NET 4.0中的Web应用程序就好了但是如果我点我本地IIS文件夹包含应用程序,我得到以下错误:
I can compile and test my .NET 4.0 web application just fine within Visual Studio 2010. If, however I point my local IIS to the folder containing the application, I get the following error:
Compiler Error Message: CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)
Source Error:
Line 388: <add namespace="System.ComponentModel.DataAnnotations" />
Line 389: <add namespace="System.Configuration" />
Line 390: <add namespace="System.Linq" />
Line 391: <add namespace="System.Text" />
Line 392: <add namespace="System.Text.RegularExpressions" />
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config Line: 390
它是如何从框架的Web.config将无法编译适合我?
How is it that the web.config from the framework won't compile for me?
我发现在网络上类似的问题,大部分只是说添加此引用...,但它不可能是正确的事情,以编辑默认的web.config - ?可它
I have found similar problems on the web and most just say 'add this reference...', but it can't be the right thing to edit the default web.config -- can it?
推荐答案
这为我工作。有这种组件在web.config文件
This worked for me. Have this assemblies in the web.config file
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
</system.web>
这篇关于在.NET 4.0中的web.config编译错误 - 找不到的Linq的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!