开发者

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:

  <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"/>
      </c开发者_如何学Goompiler>
      <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?


How about adding System.Linq in assemblies tag?


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


I am having an issue with publishing 3.5 in IIS because of this very issue. 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". 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜