How to get csc.exe path?

Rok Povsic picture Rok Povsic · Jul 12, 2011 · Viewed 93.7k times · Source

Is there a way to get path for the latest .NET Framework's csc.exe?

The file usually in: c:\Windows\Microsoft.NET\Framework\vX.X.XXX but the problem is there can be multiple versions installed + there are both 32 and 64 bit versions.

Any solution to this?

Answer

Liquid Wotter picture Liquid Wotter · Jul 12, 2011

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.