How to get csc.exe path?

Solution 1:

c:\Windows\Microsoft.NET\Framework\vX.X.XXX Should contain the latest 32 bit version of csc.exe

c:\Windows\Microsoft.NET\Framework64\vX.X.XXX Should contain the lastest 64 bit version of csc.exe

That's what it is for mine anyway.

BTW: You can access both by using the Visual Studio Command Line from your visual studio tools folder in your program files. It auto sets up all the paths you need to build 32 and 64 bit apps with your csc compiler.

Solution 2:

The best way to find CSC.exe path is running in CLI (Command Line Interpreter) that simple line:

dir /s %WINDIR%\CSC.EXE

dir - shows directory

/s - includes subfolders

%WINDIR%\CSC.EXE - looks in root folder for phrase like "CSC.exe".

And it is our result: enter image description here

Then we can simply compile example code by line like:

C:\WINDOWS\...\v.4.0.30319\CSC.exe HelloWorld.cs

Regards.