Visual Studio 2010 解决方案的 MSBuild 命令行执行无法引用 VS2010 SDK 来构建扩展

发布于 2024-12-22 08:36:02 字数 1280 浏览 4 评论 0原文

包含 VS2010 扩展的场景

  • 解决方案(.NET 4 类库,带有 WPF UI)
  • 它在 Visual Studio 中构建得很好
  • 当我尝试通过命令行构建它时(作为一部分), 在同一台机器上构建脚本)
  • 使用此命令尝试构建它时失败
    • msbuild JsExt.sln /t:Build /p:Configuration=Debug /p:OutDir=..\..\Binaries
  • 更新
    • MSBuild 添加 /property:VsSDKInstall="C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\VSSDK" 会导致此结果异常...

例外

“VSCTCompiler”任务意外失败。 C:\ Program Files(x86)\ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ VSSDK \ Microsoft.VsSDK.Common.targets(74,5):错误MSB4018: System.ArgumentNullException:值不能为空。

额外信息

  1. Visual Studio 2010 SDK SP1 已安装
  2. 文件 Microsoft.VsSDK.Common.targets 的路径确实存在。
  3. 我从 x86 控制台和 PowerShell 窗口运行,并且加载了 vcvarsall.bat (x86)
  4. 我不确定 tmp_proj 是什么关于。
  5. 它是一个 WPF 用户界面,我是否缺少通过 MSBuild 使用 WPF/XAML 编译某些内容的功能?
  6. 作为扩展名的 CSProj 文件没有任何构建前/构建后事件。
  7. 构建平台目标是任何 CPU
  8. 我有其他解决方案/项目可以使用相同的 MSBuild 命令运行良好。
  9. 设置 /v:diag 不会提供有关错误的更多信息。

有什么想法,我缺少什么,下一步要调试什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2024-12-29 08:36:02

VSSDKInstall 环境变量是否已设置/显示在控制台中?

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

如果是这样,请将“/v:diag”添加到您的命令行中,看看会出现什么结果。

看看下面的 博客文章 - 步骤 #3 听起来像是您原来的问题,步骤 #4 解释了您刚刚遇到的后续 VSCTCompiler 问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文