防止MSTest复制/部署每个dll

问题描述:

从Visual Studio运行MSTest时-单元测试执行时间相对较快.

When running MSTest from Visual Studio - the unit test execution time is relatively quick.

从命令行运行MSTest时,带有/testsettings标志-执行将永久执行,这是因为它将花费其启动时间的95%将dll复制到其Out文件夹.有办法防止这种情况吗?

When running MSTest from the command line, with /testsettings flag - the execution takes forever and that is because it spends 95% of its startup time copying the dll's to its Out folder. Is there a way to prevent this?

项目中的默认Local.testsettings没有对其进行任何修改(这也意味着它是空的).但是,如果我尝试从命令行使用同一文件,则MSTest会抱怨缺少单元测试引用的DLL.

The default Local.testsettings in the project has no modifications to it (which also means it is empty). However, if I try to use that same file from the command line, MSTest complains about missing DLL's that the Unit Test reference.

您是否尝试过在测试设置中禁用部署?禁用该选项后,应在原位运行测试,而不要在复制的程序集上运行测试. (请参见 http://msdn.microsoft.com/en-us/library/ms182475 .aspx 以获取详细信息.)

Have you tried disabling deployment in the test settings? When it is disabled, the tests should be run in-place rather than on copied assemblies. (See http://msdn.microsoft.com/en-us/library/ms182475.aspx for details.)