如何在Visual Studio 2010测试项目中关闭卷影副本? [英] How do I turn off shadow copy in a Visual Studio 2010 test project?

查看:135
本文介绍了如何在Visual Studio 2010测试项目中关闭卷影副本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用NUnit时,我可以关闭卷影副本,以便从输出目录运行我的测试程序集.之所以需要它,是因为在这种情况下,我的测试不是单元测试,而是集成测试,它需要能够访问某些由内部版本复制到输出目录中的程序集.

When using NUnit, I can turn off shadow copy so that my test assemblies are run from the output directory. I need this because my tests in this case aren't unit tests, but are integration tests which need to be able to access some of the assemblies that are copied into the output directory by the build.

但是,当我使用Visual Studio 2010测试运行程序运行Visual Studio测试项目时,我找不到关闭卷影副本的方法.

However, I can't find a way of turning off shadow copy when I'm using the Visual Studio 2010 test runner to run Visual Studio Test Projects.

有人可以让我知道该怎么做吗?

Could someone please let me know how to do that?

推荐答案

显然没有办法.相反,您必须标记要复制的程序集以及被测程序集.感谢 Ewald Hofman :

Apparently there isn't a way of doing this. Instead, you must flag the assemblies you want copied along with the assembly under test. Thanks to Ewald Hofman:

您应该将其转过来,然后使用 要引入的DeploymentItem属性 依赖程序集进入测试 环境.

You should turn it around, and use the DeploymentItem attribute to bring in the dependent assemblies into the test environment.

这篇关于如何在Visual Studio 2010测试项目中关闭卷影副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆