简体   繁体   中英

Visual Studio 2012 command line built

We use msbuild to build the solution on servers and were using the command prompt provided by sdk 7.1 to build for .net 4 for both 32 and 64 bit builds. SETENV provided in sdk was perfect for this.

Now we are upgrading to .NET 4.5 and VS 2012 Since the new Windows SDK 8 does not have a command prompt, I think we have to use the command prompt provided by Visual Studio 2012 (unless there is a better way). Now the problem is, there are 3 command prompts provided for 32, 64 bit and ARM by VS 11. Weirdly there is also a DEVELOPER COMMAND PROMPT that is picking up SDK 7.0 for some reason. So my questions are..

  1. Which is the perfect command prompt for building for .net 4.5 using sdk 8.

  2. Do I have to use different command prompts to target different platform or is there a better way to change the targeted platform without opening the new command prompt.

  3. How can I choose the right SDK as the SDK configuration tool shows the options for sdk 8.0 and 8.0A but only VS 2005 and VS 2008 options are available there to choose, and I think I want to choose VS 2012 there.

  4. A setenv equivalent for VS 2012 command prompt to set configurations and platform.

  5. Basically how to choose the correct SDK, the correct environments and the right command prompt for targeting different platforms for .NET 4.5.

I found this: http://msdn.microsoft.com/en-us/library/x4d2c09s(v=vs.110).aspx

From the Developer Command Prompt for VS2012

Any of the compilers can be used on the command line by running the Vcvarsall.bat batch file to configure the path and environment variables that enable the compiler toolset. By default, the full path of this file is either C:\\Program Files\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat on 32-bit Windows operating systems, or C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat on 64-bit systems.

Just 'cd VC' from the default route and run:

vcvarsall x86_amd64

To target x64 architecture, I just built LuaJIT-2.0.0 using this method on Windows 8 for x64 architecture, although I still dunno what the command is to set for release. I just hope it's the default.

setenv /release /x64

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM