简体   繁体   中英

MSBuild command line execution of Visual Studio 2010 Solution fails referencing VS2010 SDK to build an extension

Scenario

  • Solution that has a VS2010 extension in it (.NET 4 Class library, with a WPF UI)
  • It builds fine inside visual studio
  • On the same machine when I attempt to build it via command line (as part of a build script)
  • Fails when using this command to attempt to build it:
    • msbuild JsExt.sln /t:Build /p:Configuration=Debug /p:OutDir=..\\..\\Binaries
  • Update
    • To MSBuild Adding /property:VsSDKInstall="C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v10.0\\VSSDK" leads to this exception...

Exception

The "VSCTCompiler" task failed unexpectedly. C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v10.0\\VSSDK\\Microsoft.VsSDK.Common.targets(74,5): error MSB4018: System.ArgumentNullException: Value cannot be null.

Extra info

  1. Visual Studio 2010 SDK SP1 is installed
  2. The path to and file Microsoft.VsSDK.Common.targets does exist.
  3. I'm running from an x86 console and PowerShell window and vcvarsall.bat (x86) are loaded
  4. I'm not sure what the tmp_proj is about.
  5. It's a WPF User Interface, is there something I'm missing to compile something with WPF/XAML via MSBuild?
  6. There is nothing pre/post build events of the CSProj file that is the extension.
  7. Build platform target is Any CPU
  8. I have other solutions/projects working well with the same MSBuild command.
  9. Setting /v:diag doesn't offer much more information on the errors.

Any ideas, what am I missing, what's next to debug?

Is the VSSDKInstall env variable set / showing up in your console?

VSSDK100Install=C:\Program Files (x86)\Microsoft Visual Studio 2010 SDK SP1\

If so, then add "/v:diag" to your cmd line to see what that turns up.

Take a look at the following blog post - step #3 sounds like your original issue, and step #4 explains the subsequent VSCTCompiler issue that you just encountered.

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