Reputation: 31
Consider:
class First
{
static void Main()
{
System.Console.WriteLine("piyush");
}
}
I first started the developer command prompt by start menu → Optimize Programs → Visual Studio 2013 → Visual Studio Tools → Developer command prompt
This is shown on start:
ERROR: Cannot determine the location of the VS Common Tools folder.
C:\Program Files (x86)\Microsoft Visual Studio 12.0>
The echo command is only showing the given below:
%VS120COMNTOOLS%
After a while, it is also automatically closing itself.
The result of set VS
is:
VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
Also, is there a way to compile and run the above program as it’s possible in Eclipse for core Java without depending on the developer command prompt?
Upvotes: 2
Views: 11009
Reputation: 21711
As others have mentioned, you need to ensure your PATH
environment variable includes the path to your installed command-line tools.
However, if you installed Visual Studio, it already includes a batch command, vcvars.bat
, that does that, and includes another batch command, VsDevCmd.bat
, that runs that batch command and several other ones useful for command-line development. A shortcut to that command should have been installed in your Start menu under Microsoft Visual Studio → Visual Studio Tools. You should always run Visual Studio commands from that CLI window.
In response to the new version; if set vs
shows no environment variables starting with “VS12” then either you did not run the Visual Studio 12's (Visual Studio 2013) VsDevCmd.bat
command or it is not installed. Get Properties of the Developer Command Prompt shortcut you opened and tell us the value of the Shortcut/Target field.
You should have a C:\Program Files (x86)\Microsoft Visual Studio 12.0 directory.
Upvotes: 1
Reputation: 2246
Your Path environment variable should point to below path:
C:\Windows\Microsoft.NET\Framework64\vX.X.XXX
Or alternatively you can browse to the below path and run csc.exe:
csc C:/Dot.Net/First.cs
Upvotes: 1