MSTest:部署项目未复制到测试文件夹
我已经阅读了许多描述我的问题的帖子,但我找不到解决方案。在我的测试项目中,我有一个名为“resources”的文件夹。
- 我已将此文件夹添加到部署项目配置中。
- 我启用了部署项目,
- 我确保文件被标记为“始终复制”,
我在类级别添加了 DeploymentItem 注释。该文件永远不会使其成为测试“out”文件夹。
有人能告诉我我错过了什么吗?
[TestClass]
[DeploymentItem(@"resources\descriptor.xml")]
public class MyTests
{
[TestInitialize]
public void TestSetup()
{
XDocument descriptor = XDocument.Load("descriptor.xml"); //The barfs
}
}
I have been reading many posts that describe my problem but I cannot find a solution. In my test project I have a folder called, "resources".
- I have added this folder to the deployment items configuration.
- I enabled deployment items
- I made sure the file is marked "always copy"
I added the DeploymentItem annotment at the class level. The file never makes it the Testing "out" folder.
Can someone tell me what I missed?
[TestClass]
[DeploymentItem(@"resources\descriptor.xml")]
public class MyTests
{
[TestInitialize]
public void TestSetup()
{
XDocument descriptor = XDocument.Load("descriptor.xml"); //The barfs
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来 resharper 测试运行程序是问题所在。如果我使用 VS 测试运行程序运行测试,一切都很好。
It seems that the resharper test runner was the problem. If I run my tests using the VS test runner all is well.