2013-02-05 65 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 –

相關問題