I am using Visual studio 2015. I think it uses the cl.exe compiler which is inside the Microsoft Visual Studio 14.0\VC\bin folder to compile C++ code. Also, my understanding is that the compiler used to compile C# code is csc.exe. However, I could not find this csc.exe inside my visual studio like cl.exe. I am curious to know how visual studio compiles C# code then. I think Visual Studio uses the csc.exe which comes with .Net, generally installed in C:\Windows\Microsoft.NET\Framework\\csc.exe to compile C# code. Is my understanding correct ?
-
1I have just answer another question on this topic. Please check. Visual Studio 2015 uses the default Roslyn compiler, not the one shipped with .NET Framework.kennyzx– kennyzx2018-06-20 03:45:51 +00:00Commented Jun 20, 2018 at 3:45
-
Thanks, I went through the link. Inmycase, my visual studio 2015 does-not have Roslyn\csc.exe. Basically it does-not have csc.exe installed. So in this case, can we assume it is taking csc.exe from my .Net installation?user496934– user4969342018-06-20 04:03:21 +00:00Commented Jun 20, 2018 at 4:03
-
Did you install VS2015 or did someone else install it? Was the option to install C# unticked?cup– cup2018-06-20 04:20:41 +00:00Commented Jun 20, 2018 at 4:20
1 Answer
I cannot answer why Roslyn is not present in your VS 2015 install dir. But you can examine how Visual Studio runs the csc.exe in the output window.
Go to Tools->Options->Projects and Solutions->Build and Run, and select the build output verbosity. (you can select the most verbose option)
Then build your program. You can then check the command line used by MSBuild in the output window.
Something like, ooh, I am using VS 2017...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /platform:anycpu32bitpreferred ... (a bunch of switches omitted)
