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?
The most common fix for the csc.exe error is to uninstall the . NET Framework, then download the latest version of the framework, and reinstall it on your computer. On the download page, ensure that you download the recommended version at the top of the list. That's the most recent one.
Open the Command Prompt window (search for cmd). 3. To check if the path of the C# compiler is set as Environment Variable, type csc and press Enter. You should get something as shown below.
Open the command prompt tool and go to the directory where you saved the file. Type csc helloworld. cs and press enter to compile your code. If there are no errors in your code, the command prompt takes you to the next line and generates helloworld.exe executable file.
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.
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:
Then we can simply compile example code by line like:
C:\WINDOWS\...\v.4.0.30319\CSC.exe HelloWorld.cs
Regards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With