Navigate to path where your Visual Studio is installed. On my local it is:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\
Go to Common7\IDE directory:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE and open console here.
Now, run the following command in the commnad prompt: devenv -h
It will list all available parameters and switches of the devenv.exe. On the bottom of the output, there should be the following:
Product-specific switches:
/debugexe Open the specified executable to be debugged. The
remainder of the command line is passed to this
executable as its arguments.
/useenv Use PATH, INCLUDE, LIBPATH, and LIB environment variables
instead of IDE paths for VC++ builds.
I assume you will get shorter list, without the /useenv option, something like:
Product-specific switches:
/debugexe Open the specified executable to be debugged. The
remainder of the command line is passed to this
executable as its arguments.
That's the reason why you always get "invalid command line. unknown switch: useenv" error message.
I had the same issue and did the following to fix it:
- If you have .NET framework 4.5 installed, Uninstall it.
- Uninstall Visual Studio 2010
- Install .NET framework 4.0 before you install Visual Studio 2010 again (do not install .NET 4.5)
- Install Visaul Studio 2010.
- Now you can install .NET 4.5
I did not have enough time to investigate and to explain 'why'. But these steps sorted this issue out.