TFS 持续构建 - MSBuild - 搜索配置文件时运行测试失败
我在 VS TFS 2008 Continuous Build 上运行测试时遇到了一些问题。 问题是 MSTest.exe 在下面搜索配置文件 “C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\”路径,所以错误为:
C:\Program Files (x86)\Microsoft Visual Studio 找不到 9.0\Common7\IDE\MyConfig.config。
有一种方法可以指定 MSTest.exe 在哪里找到配置文件?
我如何在 TFSBuild.proj 中指定它?
我的 TFSBuild.proj 文件包含以下设置:
<PropertyGroup>
<RunTest>true</RunTest>
</PropertyGroup>
!
<ItemGroup>
<MetaDataFile Include="$(BuildProjectFolderPath)/../../MyProj.Complete.vsmdi">
<TestList>Continuous Integration Test</TestList>
<RunConfigFile>$(SolutionRoot)\LocalTestRun.testrunconfig</RunConfigFile>
</MetaDataFile>
</ItemGroup>
非常感谢
I'm having a little problem with Running Test on VS TFS 2008 Continuous Build.
The problem is that MSTest.exe search config file under
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\" path, so the error is:
C:\Program Files (x86)\Microsoft Visual Studio
9.0\Common7\IDE\MyConfig.config could not be found.
There is a way to specify to MSTest.exe where found config files?
How I can specify that in the TFSBuild.proj?
My TFSBuild.proj file contains these settings:
<PropertyGroup>
<RunTest>true</RunTest>
</PropertyGroup>
and
<ItemGroup>
<MetaDataFile Include="$(BuildProjectFolderPath)/../../MyProj.Complete.vsmdi">
<TestList>Continuous Integration Test</TestList>
<RunConfigFile>$(SolutionRoot)\LocalTestRun.testrunconfig</RunConfigFile>
</MetaDataFile>
</ItemGroup>
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 DeploymentItemAttribute 在您的单元测试代码中。因此,您可以控制测试运行期间部署哪些文件以及部署在何处。例如:
这将在测试运行之前将 MyConfig.config 文件复制到当前目录。
希望有帮助,
Use DeploymentItemAttribute in your Unit Tests code. So you can control what files and where are deployed during a test run. For example:
This will copy MyConfig.config file to the current directory before a test run.
Hope that helps,