CSC version at computer

℡╲_俬逩灬. 提交于 2019-11-30 18:42:48

问题


I making fast changes in my code via Visual Studio Code. As you know it doesn't have build-in compiler so I using CSC via CMD.

It's working good only for ( code <= C# 4.6 & code <= .NET 4.5 ) because that version of CSC I have.

And there is problem because I writing in new C# 6.0 and .NET 4.6 and can't compile via CSC. I have installed VS 2015 with .NET 4.6 and compilie via VS 2015 working good.

I can't find CSC in version witch support CSC in version .NET 4.6 in my computer. I have .NET 4.6 in Windows Registry(regedit).


回答1:


csc.exe compiler used by Visual Studio 2015 is located at c:\Program Files (x86)\MSBuild\14.0\bin\csc2.exe




回答2:


CSC is no longer used for compilation of C# 6+. The new standard compiler is Roslyn now.

In fact, csc itself tells you this:

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240

You need to download Roslyn (either using the link above and compiling it for yourself using MSBuild, or via NuGet at http://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp/) and use it to compile your programs from now on.



来源:https://stackoverflow.com/questions/31698319/csc-version-at-computer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!