command-line - MSTest.exe 没有复制所有需要的项目 DLL?

标签 command-line mstest

我正在尝试运行 MSTest.exe,但似乎未正确读取 testcontainer;而我的测试在 Visual Studio 中的所有配置环境中都成功运行。

我使用的命令是:

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /nologo /usestderr /testSettings:"C:\temp\MyProject\Sources\MyProject\Local.testsettings" /searchpathroot:"C:\temp\MyProject\Binaries" /resultsfileroot:"C:\temp\MyProject\TestResults" /testcontainer:"C:\temp\MyProject\Binaries\MyProject.Services.Server.UnitTests.dll" 

testcontainer 项目中的项目引用如下所示:

<ItemGroup>
    <ProjectReference Include="..\..\Services\MyProject.Services.Server\MyProject.Services.Server.csproj">
        <Project>{92EC1999-CC0C-47DD-A4D6-17C3B1233C50}</Project>
        <Name>MyProject.Services.Server</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\SvcConfiguration\MyProject.ServiceConfiguration.Interfaces\MyProject.ServiceConfiguration.Interfaces.csproj">
        <Project>{8E2E7BA9-75DB-458E-A184-AC1030EAD581}</Project>
        <Name>MyProject.ServiceConfiguration.Interfaces</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\SvcConfiguration\MyProject.ServiceConfiguration.Services\MyProject.ServiceConfiguration.Services.csproj">
        <Project>{39514766-23A8-45DB-96EA-B6B4D9C8B086}</Project>
        <Name>MyProject.ServiceConfiguration.Services</Name>
    </ProjectReference>
</ItemGroup>

ServiceConfiguration.Interfaces 和 ServiceConfiguration.Services DLL 都不会放入 TestResults 中的 Out 文件夹中。

项目 GUID 在引用和引用的项目之间确实匹配。

命令行中是否缺少某些内容?

最佳答案

mstest.exe 不会复制所有引用的 dll。

请参阅有关此内容的博客文章 https://web.archive.org/web/20111221110459/http://www.dotnetthoughts.net/2011/11/22/mstest-exe-does-not-deploy-all-items/

关于command-line - MSTest.exe 没有复制所有需要的项目 DLL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8083491/

相关文章:

c# - 使用 FakeItEasy 的 Winrt 测试项目

c# - 从 Visual Studio 2015 中的代码覆盖率中排除自动属性

visual-studio-2010 - 在 Team City Build Server 上运行 MSTest 测试需要 Visual Studio?

Maven Enforcer 插件 : Specify rules via command line

kubernetes - 如何将命令行参数传递给kubectl create命令

c# - 向 stdin 发送命令并发送传输结束 (Ctrl+D)

msbuild - 如何使用MSBuild运行MSUnit测试

command-line - 无法在cmder中更改驱动器

java - 从带文件结尾的命令行运行 Java 与不带文件结尾的 Java 之间的区别

mstest - 在 SpecFlow 步骤绑定(bind)类中访问 TestContext