如何使用MsBuild构建包含MsTest测试项目的解决方案?

发布于 2024-10-10 19:46:16 字数 392 浏览 6 评论 0原文

我想从命令行构建解决方案,但是当我在安装了 Visual Studio 2010 的计算机中运行 MsBuild 时,我仍然收到以下错误:

C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets:警告 MSB3245:无法解析此引用。无法找到程序集“Microsoft.VisualStudio.QualityTools.UnitTestFramework,Version=10.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a,processorArchitecture=MSIL”。检查以确保该程序集存在于磁盘上。如果您的代码需要此引用,您可能会遇到编译错误。

I want to build the solution from the command line, but when I run MsBuild in a machine with Visual Studio 2010 installed I still receive the following error:

C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

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

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

发布评论

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

评论(1

养猫人 2024-10-17 19:46:16

C:\Windows\Microsoft.NET\Framework\**v3.5**\Microsoft.Common.targets

请注意版本号,您获得的 .targets 文件版本错误。对于 VS2010,应该是 4.0.30319。不确定您做了什么来启动 msbuild,但请务必使用 VS2010 命令行提示符。这可能不是你的麻烦的结束,不确定,程序集位于 C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies,这是一个 VS 特有的目录。

C:\Windows\Microsoft.NET\Framework\**v3.5**\Microsoft.Common.targets

Note the version number, you are getting the wrong version of the .targets file. For VS2010 that should be 4.0.30319. Not sure what you did to get msbuild started but be sure to use the VS2010 Command Line Prompt. That might not be the end of your troubles, not sure, the assembly lives in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies, a directory pretty specific to VS.

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