Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015: No 64-bit command prompt

In previous versions of Visual Studio, there were separate command prompts for x86 and x64. In VS2015, there's only one, and it's forced to 32-bit explicitly.

@call "%VS140COMNTOOLS%VCVarsQueryRegistry.bat" 32bit No64bit

My project launches a batch file pre- and post-build to call installutil to uninstall/reinstall my windows service. When building for x64, I get the message:

System.BadImageFormatException: Could not load file or assembly... 
An attempt was made to load a program with an incorrect format

Rather than fall down the rabbit hole trying to change the scripts, does someone have an easy solution to launching a 64-bit visual studio command prompt? I can't believe this isn't installed by default.

like image 981
James King Avatar asked Feb 02 '26 16:02

James King


1 Answers

You can run this from a standard command prompt:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

Or more directly,

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"

Edit according to your install location, of course.

like image 178
Matthew Read Avatar answered Feb 05 '26 08:02

Matthew Read



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!