danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
https://reportgenerator.io
Apache License 2.0
2.6k stars 280 forks source link

Add ReportGenerator.DotnetCorePluginLoader to netstandard2.0 lib folder #508

Closed MarcoRossignoli closed 2 years ago

MarcoRossignoli commented 2 years ago

Hi @danielpalme,

I'd like to use ReportGenerator.Core to merge and generate html on the fly inside coverlet, but looks like is failing if ReportGenerator.DotnetCorePluginLoader is not found in case of netcore app.

Can you add it to the nestandard2.0 package?

danielpalme commented 2 years ago

Hi Marco, the package ReportGenerator.Core is dedicated to write plugins for ReportGenerator. I did not have in mind, that it's used directly.

The problem here is, that ReportGenerator.Core targets nestandard2.0. However ReportGenerator.DotnetCorePluginLoader targets .net: https://github.com/danielpalme/ReportGenerator/blob/bf487cba56912ff5b5ab4bb1d35d1336dbe2151f/src/ReportGenerator.DotnetCorePluginLoader/ReportGenerator.DotnetCorePluginLoader.csproj#L3

Adding the dll to the nestandard2.0 package seems wrong.

Can you share a snippet, of your code which you are using to merge the reports. I will have look and maybe there's a better solution to work around the problem or that I can provide a better API.

MarcoRossignoli commented 2 years ago

I was experimenting one idea and I need to be able to merge/generate report on the fly from a netstandard2.0 app and without ReportGenerator.DotnetCorePluginLoader it will fail.

https://github.com/MarcoRossignoli/coverlet/blob/mergereports/src/coverlet.collector/DataCollection/DataCollectorAttachmentProcessor.cs#L49

danielpalme commented 2 years ago

Thanks for your code sample. I will have a look within the next days!

MarcoRossignoli commented 2 years ago

sure no rush and thanks a lot!

danielpalme commented 2 years ago

I tried to to reproduce your problem. What steps are required to run into an error? Do you have a unit test or can you give a short step by step description?

MarcoRossignoli commented 2 years ago

Sry for the late response...this is my sample

https://github.com/MarcoRossignoli/coverlet/blob/mergereports/src/coverlet.collector/DataCollection/DataCollectorAttachmentProcessor.cs#L49

I want to be able to merge/generate report on the fly at the end of the test run and I'd like to use report generator because implements already all the logic. Project is a netstandard2.0 one and inside the package that lib is missing for netstandard2.0 tfm.

danielpalme commented 2 years ago

You already mentioned your sample code above. That's not my problem.

I want to reproduce your issue. How can I execute your code, so that I run into an error or exception? Is there a unit test? Or can I create a console application? If yes, should it target net6.0?

Thanks for your input!

MarcoRossignoli commented 2 years ago

You can create a console app referencing a netstandard2.0 lib that references your package...and run that code(in the sample) inside the netstandard2.0 project. ConsoleApp -> netstandard2.0 Project -> ReportGenerator.Core image

danielpalme commented 2 years ago

Thanks, now I'm able to reproduce the problem.

danielpalme commented 2 years ago

I just published release 5.1.5. Could you please try again with this version.

MarcoRossignoli commented 2 years ago

thanks a lot!

danielpalme commented 2 years ago

I'm closing this issue. Feel free to reopen if you have any problem.