2013-02-05 77 views
0

我试图与MSTest的的Windows Server 2008 R2的计算机上运行OpenCover,总是得到空的结果:OpenCover显示Windows服务器上没有结果2008年

c:\OpenCover>OpenCover.Console.exe -register:user -target:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MsTest.exe" -targetdir:"c:\MyApp\bin" -targetargs: /testcontainer:"C:\MyApp\Tests\bin\UnitTests.dll" -output:c:\cover.xml

Microsoft (R) Test Execution Command Line Tool Version 11.0.51106.1

Copyright (c) Microsoft Corporation. All rights reserved.

Please specify tests to run, or specify the /publish switch to publish results.

For switch syntax, type "MSTest /help"

Committing...

No results - no assemblies that matched the supplied filter were instrumented this could be due to missing PDBs for the assemblies that match the filter please review the output file and refer to the Usage guide (Usage.rtf)

在指定的文件夹和剖析存在的PDB文件使用regsvr(x64和x86)注册DLL。 Microsoft Visual C++ 2010可再发行组件包已安装。 .NET框架3.5,4.5安装。 我试图在没有管理员权限的情况下运行它...

与此同时,它完美地运行在装有VS 2012的win7 x64机器上,所以我想我已经错过了一些依赖或者这是一个安全问题。

enter image description here

回答

2

哪个OpenCover的版本:

去掉引号和空格我收到了较好的效果,但仍然没有代码覆盖后?

The latest version should not require "Microsoft Visual C++ 2010 Redistributable Package"

如果已经使用resvr32注册的组件,那么你不需要-register:user开关。

因为它看起来并不像你的测试运行,它看起来像你正在经历是不正确的("-targetargs: /target..."之间的空间的参数,请尝试:

"-targetargs:/testcontainer:C:\MyApp\Tests\bin\UnitTests.dll"

+0

哦,不......我花了因为这个空间在我的参数中占用了很多时间,非常感谢。现在看起来工作正常,但是在OpenCover执行结束时仍然出现一个错误,生成了XML文件,但在“Total Results file:C:\ bla-bla 2013-02-06 10_30_30.trx 测试设置:默认测试设置 正在提交...“我仍然收到此错误:没有结果 - 没有匹配的程序集ed等 – msaruyev

+0

正如我从XML看到的PDBs丢失,但所有必需的PDB文件都在目标目录 – msaruyev

+0

尝试删除引号或包装整个参数'“-targetdir:...”'或者添加mstest参数'/ noislation'到targetargs –

相关问题