Why can't the command-line csc compile C# 7 after installing VS 2017?

前端 未结 2 1320
独厮守ぢ
独厮守ぢ 2021-01-12 18:52

I just downloaded Visual Studio 2017 RC, which was released a few days ago and comes with support for C# 7. I can use C# 7 features from the IDE:

2条回答
  •  心在旅途
    2021-01-12 19:07

    You can run "where csc.exe" from the visual studio 2017 command prompt and export the version of csc you need by adding it to the Path system variable. I was in a similar case where i needed to compile via command line and i ended up setting

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\
    

    in system Path.

提交回复
热议问题