I've recently migrated/adapted a web site built on ASP.NET 2.0 (.NET Framework 2.0) to .NET Framework 3.5.
Oh the goodies of .NET Framework 3.5 : LINQ, lambdas, automatic properties and so on. At first I just set the build option to .NET Framework 3.5 :
Everything fine and dandy till I ran the site :
WTF? I mean it is set to use the .NET Framework 3.5, it should see that these are automatic properties not abstract property fragments. Well it doesn't. After a few comparisons of the Web.config files with freshly created .NET 3.5 web sites I discovered what has to be done : include the system.codedom element in web config just as a child of the configuration element :
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
That's it! It works fine now. I hope this can help some of you :)
c91c1b79-9fad-4d93-b731-e6e8bc8adb9d|0|.0