How to use C# 6 with Web Site project type?

前端 未结 7 2143
说谎
说谎 2020-11-30 22:23

Updated an existing Web Site project type Visual Studio 2015, I changed the Framework to 4.6.

I then expected to have all those new features available in my

7条回答
  •  攒了一身酷
    2020-11-30 22:57

    This is not for a Web Site Project. This is how you do it for an ASP.NET MVC project.

    You can toggle C# 6 in the Visual Studio UI. This is such an easy option, it is worth trying first.

    1. Right click your project and select Properties.
    2. Click the Build tab.
    3. The build tab has an Advanced... button at the very bottom.
    4. This opens up the Advanced Build Settings as shown below. Select C# 6.0.

提交回复
热议问题