question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Update doc only new SDK style supported]error MSB4044: The "Coverlet.MSbuild.Tasks.CoverageResultTask" task was not given a value for the required parameter "InstrumenterState".

See original GitHub issue

Hello GitHubFamily,

I m trying to use publish code coverage for Nunit test. I have created my pipeline from Azure DevOps and utilizing .Net Core (test) task to execute unit test cases and publish code coverage. However, I am getting above mentioned error.

So what all I have done: A unit test project in VS 2019. Few sample unit test. From Manage Nuget, got Nunit, Nunit test adapter and code coverage tool - coverlet.msbuild

Reference screenshot: image

Below is the pipeline I am using: image

I had below package.config after installing the nuget component. However, as I received an error I carried out certain modifications in the hope to fix the issue. The comment code was by default and the uncommented one is modified one.

image

I am not using, however, putting YAML for .NET Core (test) if that helps: steps:

  • task: DotNetCoreCLI@2 displayName: ‘Test copy’ inputs: command: test projects: ‘D:\CurrentUnitTestAgent_WorkingFolder**\CodeCoverageScenario\CodeCoverageScenario.sln’ arguments: ‘/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/’ condition: succeededOrFailed()

Error Logs: 2020-05-13T03:13:52.2844751Z ##[debug] D:\CurrentUnitTestAgent_WorkingFolder_temp (directory) 2020-05-13T03:13:52.2847095Z ##[debug] D:\CurrentUnitTestAgent_WorkingFolder_temp.taskkey (file) 2020-05-13T03:13:52.2847572Z ##[debug] D:\CurrentUnitTestAgent_WorkingFolder_tool (directory) 2020-05-13T03:13:52.2849611Z ##[debug]20316 results 2020-05-13T03:13:52.2850152Z ##[debug]found 20316 paths 2020-05-13T03:13:52.2850393Z ##[debug]applying include pattern 2020-05-13T03:13:52.4039424Z ##[debug]1 matches 2020-05-13T03:13:52.4039969Z ##[debug]1 final results 2020-05-13T03:13:52.4041899Z ##[debug]which ‘C:\Program Files\dotnet\dotnet.exe’ 2020-05-13T03:13:52.4043770Z ##[debug]found: ‘C:\Program Files\dotnet\dotnet.exe’ 2020-05-13T03:13:52.4044414Z ##[debug]which ‘C:\Program Files\dotnet\dotnet.exe’ 2020-05-13T03:13:52.4044961Z ##[debug]found: ‘C:\Program Files\dotnet\dotnet.exe’ 2020-05-13T03:13:52.4045317Z ##[debug]C:\Program Files\dotnet\dotnet.exe arg: test 2020-05-13T03:13:52.4045718Z ##[debug]C:\Program Files\dotnet\dotnet.exe arg: D:\CurrentUnitTestAgent_WorkingFolder\10\s\CodeCoverageScenario\CodeCoverageScenario.sln 2020-05-13T03:13:52.4046661Z ##[debug]C:\Program Files\dotnet\dotnet.exe arg: --logger trx --results-directory “D:\CurrentUnitTestAgent_WorkingFolder_temp” /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=D:\CurrentUnitTestAgent_WorkingFolder\10\s/TestResults/Coverage/ 2020-05-13T03:13:52.4050222Z ##[debug]exec tool: C:\Program Files\dotnet\dotnet.exe 2020-05-13T03:13:52.4050696Z ##[debug]arguments: 2020-05-13T03:13:52.4051132Z ##[debug] test 2020-05-13T03:13:52.4051884Z ##[debug] D:\CurrentUnitTestAgent_WorkingFolder\10\s\CodeCoverageScenario\CodeCoverageScenario.sln 2020-05-13T03:13:52.4052521Z ##[debug] --logger 2020-05-13T03:13:52.4052727Z ##[debug] trx 2020-05-13T03:13:52.4053271Z ##[debug] --results-directory 2020-05-13T03:13:52.4054068Z ##[debug] D:\CurrentUnitTestAgent_WorkingFolder_temp 2020-05-13T03:13:52.4054331Z ##[debug] /p:CollectCoverage=true 2020-05-13T03:13:52.4054719Z ##[debug] /p:CoverletOutputFormat=cobertura 2020-05-13T03:13:52.4055020Z ##[debug] /p:CoverletOutput=D:\CurrentUnitTestAgent_WorkingFolder\10\s/TestResults/Coverage/ 2020-05-13T03:13:52.4055789Z [command]“C:\Program Files\dotnet\dotnet.exe” test D:\CurrentUnitTestAgent_WorkingFolder\10\s\CodeCoverageScenario\CodeCoverageScenario.sln --logger trx --results-directory D:\CurrentUnitTestAgent_WorkingFolder_temp /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=D:\CurrentUnitTestAgent_WorkingFolder\10\s/TestResults/Coverage/ 2020-05-13T03:13:53.4661372Z D:\CurrentUnitTestAgent_WorkingFolder\10\s\CodeCoverageScenario\packages\coverlet.msbuild.2.8.1\build\coverlet.msbuild.targets(36,5): error MSB4044: The “Coverlet.MSbuild.Tasks.CoverageResultTask” task was not given a value for the required parameter “InstrumenterState”. [D:\CurrentUnitTestAgent_WorkingFolder\10\s\CodeCoverageScenario\CodeCoverageScenario\CodeCoverageScenario.csproj] 2020-05-13T03:13:53.5122497Z ##[debug]Exit code 1 received from tool ‘C:\Program Files\dotnet\dotnet.exe’ 2020-05-13T03:13:53.5132567Z ##[debug]STDIO streams have closed for tool ‘C:\Program Files\dotnet\dotnet.exe’ 2020-05-13T03:13:53.5195070Z ##[error]Error: The process ‘C:\Program Files\dotnet\dotnet.exe’ failed with exit code 1 2020-05-13T03:13:53.5210877Z ##[debug]Processed: ##vso[task.issue type=error;]Error: The process ‘C:\Program Files\dotnet\dotnet.exe’ failed with exit code 1 2020-05-13T03:13:53.5212306Z ##[debug]BuildConfiguration=undefined 2020-05-13T03:13:53.5213241Z ##[debug]BuildPlatform=undefined 2020-05-13T03:13:53.5213804Z ##[debug]testRunTitle=null 2020-05-13T03:13:53.5214680Z ##[debug]defaultRoot: ‘D:\CurrentUnitTestAgent_WorkingFolder_temp’

Ask: How shall I resolve the issue - error MSB4044: The “Coverlet.MSbuild.Tasks.CoverageResultTask” task was not given a value for the required parameter “InstrumenterState”.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:26

github_iconTop GitHub Comments

7reactions
DanielPohlmanncommented, Jun 28, 2020

Hello, install package Microsoft.NET.Test.Sdk solve error MSB4044: The “Coverlet.MSbuild.Tasks.CoverageResultTask” task was not given a value for the required parameter “InstrumenterState”.

2reactions
Ahetejazcommented, May 15, 2020

Hello Marco,

Thank you for all the help.

Yes, for the new projects (NET Core) with SDK it works fine. Let me try to update my existing test project (.NET Framework) to have a new style SDK. Let me see how the project could be updated to have the new SDK style. I would try to update the project and let you know.

I appreciate all the help.

Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "Coverlet.MSbuild.Tasks.CoverageResultTask ...
msbuild.targets(41,5): error MSB4044: The “Coverlet.MSbuild.Tasks.CoverageResultTask” task was not given a value for the required parameter ...
Read more >
Error when running unit test from console using Visual ...
msbuild.targets(71,5): error MSB4044: The "Coverlet.MSbuild.Tasks.CoverageResultTask" task was not given a value for the required parameter " ...
Read more >
coverlet
Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with .NET Framework...
Read more >
Error 'Unable to read beyond the end of the stream. ' in CL ...
Hello,. starting from yesterday we are encountering the following error during build test and collecting test results
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found