Inspired by the discussion on
https://stackoverflow.com/questions/31548699/how-to-use-c-sharp-6-with-web-site-project-type
But cannot be directly applied to VS2019 and project created with Solution - Add / Existing Website
My solution
(web) Project - Property Pages - Tab "Build"
Change Target Framework to ".NET Framework 4.6"
<compilation debug="true" targetFramework="4.6"/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
But interpolated strings etc. still do not work ...
A new menu item appears - Build - ASP:NET Compilation -> Enable ...features ...
Now select, which project will be upgraded, and VS automatically added:
- Nuget package
- New folder Bin/Microsoft.CodeDom.Providers.DotNetCompilerPlatform
- New lines in Web.config:
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom. ...
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" ...
</compilers>
</system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom. ...
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" ...
</compilers>
</system.codedom>
... now it finally works
Žádné komentáře:
Okomentovat