简体   繁体   English

命名空间中不存在类型或命名空间名称“Linq”

[英]The type or namespace name 'Linq' does not exist in the namespace

Im trying to publish my site on an server and have been receiving this message:我试图在服务器上发布我的网站并收到此消息:

The type or namespace name 'Linq' does not exist in the namespace.

Been trying to fix it now`for a while, no matter what i do, nohing is working.一直在尝试修复它一段时间,无论我做什么,都没有工作。 Ive been trying to add the following to my webconfig file:我一直在尝试将以下内容添加到我的 webconfig 文件中:

  <compilation debug="false">
    <assemblies>
      <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
  </compilation>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"              type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"              warningLevel="4">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"              type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"              warningLevel="4">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="OptionInfer" value="true"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
    </compilers>
  </system.codedom>

Any suggestions?有什么建议么?

I assume the application works locally?我假设应用程序在本地工作? Seems a bit obvious but are you sure that the server you are publishing to has .net 3.5 installed?似乎有点明显,但您确定要发布到的服务器安装了 .net 3.5 吗?

How about adding System.Linq in assemblies tag?在程序集标签中添加System.Linq怎么样?

I am having an issue with publishing 3.5 in IIS because of this very issue.由于这个问题,我在 IIS 中发布 3.5 时遇到问题。 The schema for Web.config files doesn't support the providerOption element and so when I publish using WebDAV the config file is emptied because it "isn't valid". Web.config 文件的架构不支持 providerOption 元素,因此当我使用 WebDAV 发布时,配置文件被清空,因为它“无效”。 You may have this working on your machine but check that your Web.config is being honored on the server or if it is empty after you deploy.您可能在您的机器上运行此程序,但请检查您的 Web.config 在服务器上是否得到认可,或者在部署后它是否为空。

check version of .net frame work on server if its higher than 2 if you are using iis7 set Application Pool of your virtual directory to asp.net 4 application pool如果您使用 iis7,请检查服务器上 .net 框架的版本是否高于 2 将虚拟目录的应用程序池设置为 asp.net 4 应用程序池

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型或命名空间名称“Linq”不存在 - The type or namespace name 'Linq' does not exist 类型或名称空间名称在名称空间中不存在 - The type or namespace name does not exist in the namespace 名称空间中不存在类型或命名空间名称“GetName” - The type or namespace name 'GetName' does not exist in the namespace 类型或名称空间名称“ MIDI”在名称空间中不存在 - The type or namespace name 'MIDI' does not exist in the namespace 命名空间中不存在类型或命名空间名称“Exchange” - The type or namespace name 'Exchange' does not exist in the namespace 类型或名称空间名称“ Confidence”在名称空间中不存在 - The type or namespace name 'Confidence' does not exist in the namespace 命名空间中不存在类型或命名空间名称 - type or namespace name does not exist in the namespace 命名空间中不存在类型或命名空间名称“优化” - The type or namespace name 'Optimization' does not exist in the namespace 命名空间中不存在类型或命名空间名称“Core” - The type or namespace name 'Core' does not exist in the namespace 命名空间中不存在类型或命名空间名称“DirectoryServices”? - The type or namespace name 'DirectoryServices' does not exist in the namespace?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM