[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 issueHello 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:
Below is the pipeline I am using:
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.
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:
- Created 3 years ago
- Comments:26
Top GitHub Comments
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”.
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.