简体   繁体   English

如何防止在单元测试结果“out”文件夹中生成pdb文件?

[英]How to prevent pdb files from being generated in unit test results “out” folder?

When I run unit tests via mstest.exe, the test results folder contains .pdb files. 当我通过mstest.exe运行单元测试时,测试结果文件夹包含.pdb文件。 These files are not supposed to be there as they interfere with the automated build system. 这些文件不应该存在,因为它们会干扰自动构建系统。 Is there any way to prevent those files from being generated? 有没有办法阻止生成这些文件?

Running unit tests doesn't produce .pdb files. 运行单元测试不会生成.pdb文件。 Compiling the tests does. 编译测试确实。 Check your build settings. 检查您的构建设置。 It is the /pdb argument to the compiler, in case you are not using msbuild. 如果您不使用msbuild,它是编译器的/ pdb参数。

One exception, you could get .pdbs if you are unit-testing code that uses System.CodeDom. 一个例外,如果您正在使用System.CodeDom进行单元测试代码,则可能会获得.pdbs。 In which case checking that you get the .pdbs ought to be part of the test. 在这种情况下,检查您获得.pdbs应该是测试的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM