PDA

View Full Version : How to specify Visual C# 2008 for ASP.NET 3.5 site?


petersunnet
04-04-2008, 06:26 AM
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)






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.

bruce
04-04-2008, 06:34 AM
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 (http://www.DiscountASP.NET)

petersunnet
04-04-2008, 09:18 AM
Resolved. Thanks.