How to specify Visual C# 2008 for ASP.NET 3.5 site?

Discussion in 'ASP.NET / ASP.NET Core' started by petersunnet, Apr 4, 2008.

  1. I am trying to deploy my first ASP.NET 3.5 site. I have got a compiler error on one App_Code .cs file with LINQ code in it, where Visual C# 2005 is being used (see below)






    Code:
    c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" ...Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.1433
    ...

    I would expect Visual C# 2008 Compiler should be used. Do I need to configure something with web.config, etc? The site works on my machine within VS 2008 environment.


    Thanks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    VS.NET 2008 should automatically stick something into your web.config file to tell the server to use a different compiler

    Something like this

    <system.codedom>
    <compilers>
    <compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/warnaserror-" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5" />
    </compiler>
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" compilerOptions="/optioninfer+" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5" />
    </compiler>
    </compilers>
    </system.codedom>


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Resolved. Thanks.
     

Share This Page