如何使用MsBuild构建包含MsTest测试项目的解决方案?
我想从命令行构建解决方案,但是当我在安装了 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.