0

I have this error in Publish code coverage results in pipeline in azure devops

Failed to generate Html report. Error: 1

can you help me plz ??

this is my Publish code coverage results sittings

Publish code coverage results sittings pic

and this is my logs

==============================================================================
"C:\Program Files\dotnet\dotnet.exe" C:\Azure DevOps Agent\agent prod\_work\_tasks\PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97\1.160.3\netcoreapp2.0\ReportGenerator.dll -reports:**/testresults/coverage/code-coverage.xml -targetdir:C:\Azure DevOps Agent\agent prod\_work\_temp\cchtml -reporttypes:HtmlInline_AzurePipelines
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-C:\Azure does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
##[warning]Failed to generate Html report. Error: 1
Reading code coverage summary from 'C:\Azure DevOps Agent\agent prod\_work\3\s\testresults\coverage\code-coverage.xml'
Async Command Start: Publish code coverage
Publishing coverage summary data to TFS server.
 Lines- 0 of 0 covered.
 Branches- 0 of 0 covered.
Modifying Cobertura Index file
Publishing code coverage files to TFS server.
Uploading 1 files
File upload succeed.
Published 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\Code Coverage Report_374' as artifact 'Code Coverage Report_374'
Async Command End: Publish code coverage
Finishing: Publish code coverage from **/testresults/coverage/code-coverage.xml

and this my code-coverage.xml path

code-coverage.xml path pic

1 Answers1

0

It could be that many of the pathes are without cautation " or ' like hier for example

"C:\Program Files\dotnet\dotnet.exe" C:\Azure DevOps Agent\agent prod\_work...

or hier -targetdir:C:\Azure DevOps Agent\agent prod\_work\_temp\cchtml.

Which made me think that, was the error message in your log: * You intended to execute a .NET program, but dotnet-C:\Azure does not exist. From this dotnet-C:\Azure i assume, because the space in the path it thought that you are providing a parameter.

A correct call should be like this: -targetdir: "C:\Azure DevOps Agent\agent prod\_work\_temp\cchtml"

Somar Zein
  • 170
  • 6
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 17 '21 at 14:24
  • can you explain more? – Rawan Aldaej Nov 18 '21 at 06:27
  • Sorry for that, i had explaind more what i meant bei that – Somar Zein Nov 18 '21 at 08:39
  • @RawanAldaej was you able to fix the problem. If not, can you please provide more information. – Somar Zein Nov 19 '21 at 09:41