Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"/>
      </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?

like image 779
dumbel Avatar asked Feb 01 '26 12:02

dumbel


2 Answers

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?

like image 68
Ben Robinson Avatar answered Feb 03 '26 01:02

Ben Robinson


How about adding System.Linq in assemblies tag?

like image 45
Aamir Avatar answered Feb 03 '26 01:02

Aamir