I have a .NET 3.5 (target framework) web application. I have some code that looks like this:
public string LogPath { get; private set; }
public string ErrorMsg
This also happens on a raw web site project where there was no web.config generated.
Although the solution file said 3.5, .Net needed the web.config to state it also to recognize. I ran debug allowing it to create a webconfig, and all was working.
So it is like the answer provided, but just make sure you have one.
add to web.config
<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>
</compilers>
</system.codedom>
You are correct; that style is allowed.
I'd look into the standard assemblies referenced. I'm not sure which you'd need to get that to compile, but I figure somewhat you're pointing to the .Net v2.0 version of csc.exe.