I wrote a simple C# file. When I compile it using command prompt, I get an error
'csc' is not recognized as an internal or external command, operable program or batch file.
Do I need to set an environment variable?
I wrote a simple C# file. When I compile it using command prompt, I get an error
'csc' is not recognized as an internal or external command, operable program or batch file.
Do I need to set an environment variable?
When you install Visual Studio it comes with it a batch file that sets up the environment for you and opens a cmd window. It's called Developer Command Prompt for VS201x
(where x is the Visual Studio version you have). It is located in the Visual Studio Tools menu, usually at:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 201x\Visual Studio Tools
This is the result:
EDIT:
If you don't have Visual Studio installed you can still access the C# compiler shipped with the .NET Framework in Windows 8. You will find it in:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Otherwise you can install it manually. Here is the link
What you need to do after is just adding it to your environment variable path
Hope it helps.