3

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?

V4Vendetta
  • 37,194
  • 9
  • 78
  • 82
dumbel
  • 205
  • 5
  • 15

4 Answers4

5

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?

Ben Robinson
  • 21,601
  • 5
  • 62
  • 79
2

How about adding System.Linq in assemblies tag?

Aamir
  • 14,882
  • 6
  • 45
  • 69
1

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.

  • Oh and if anyone has a solution to this, apart from "delete the codedom section" which stops it being .NET 3.5 or "add something to the FX_schema.xml" file which I can not access I am all ears. – misterscratch Oct 02 '12 at 14:56
  • Since someone may need this information some day I posted my problem here and when I just did what I thought I should I posted[my answer](http://stackoverflow.com/questions/12680320/publishing-asp-net-3-5-site-leaves-web-config-empty-due-to-provideroptions-eleme/12696437#12696437). The answer is to write a schema file that only contains the section you wish to override and add the element you need. – misterscratch Oct 02 '12 at 19:01
1

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

DeveloperX
  • 4,633
  • 17
  • 22