C# 7 features don't work within a web project on Visual Studio 2017 RC

前端 未结 2 732
感情败类
感情败类 2020-12-18 21:07

I have several projects in the solution, and the C# 7 features, such as tuples and throw expressions, work fine in all of the library projects, but there is a (non Core) web

2条回答
  •  心在旅途
    2020-12-18 22:08

    I got here trying to answer why C #7 features weren't working in VS2017. I had just upgraded an existing project just like the answer said, and at the end had gotten a message about the compiler DLL being in use and VS needing a restart.

    Afterward I could type C# 7 code in the IDE fine, but it would always fail on compilation of any new feature usage. Turns out the .csproj file itself had imports for the new and old compiler like below. These did not show in the references list in the project. I deleted the old imports lines and was good to go.

    
    
      
      
      
      
      

提交回复
热议问题