Reportgenerator: Using ReportGenerator in MSBuild is broken with dotnet core sdk 3.1.200

Created on 27 Mar 2020  路  4Comments  路  Source: danielpalme/ReportGenerator

Using global.json to control the specific sdk being used, when the sdk is 3.1.100, the report is created normally. When sdk is 3.2.100, the report fails to create with the following stacktrace:

2020-03-27T06:45:54: Sequence contains no elements
2020-03-27T06:45:54:    at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   at Palmmedia.ReportGenerator.Core.Plugin.ReflectionPluginLoader.CreateAssemblyLoader() in C:\Users\jarmen\Downloads\ReportGenerator-master\ReportGenerator-master\src\ReportGenerator.Core\Plugin\ReflectionPluginLoader.cs:line 118
   at Palmmedia.ReportGenerator.Core.Plugin.ReflectionPluginLoader..ctor(IReadOnlyCollection`1 plugins) in C:\Users\jarmen\Downloads\ReportGenerator-master\ReportGenerator-master\src\ReportGenerator.Core\Plugin\ReflectionPluginLoader.cs:line 39
   at Palmmedia.ReportGenerator.Core.Generator.GenerateReport(IReportConfiguration reportConfiguration, Settings settings, RiskHotspotsAnalysisThresholds riskHotspotsAnalysisThresholds) in C:\Users\jarmen\Downloads\ReportGenerator-master\ReportGenerator-master\src\ReportGenerator.Core\Generator.cs:line 100

For some reason, in ReflectionPluginLoader.CreateAssemblyLoader typeof(IAssemblyLoader).IsAssignableFrom(t) returns false. Generator is being run using ReportGenerator msbuild task

bug

All 4 comments

Thanks for reporting this issue. Will have look at the problem.

I was able to reproduce your issue.

I opened an issue here: https://github.com/dotnet/sdk/issues/11043

In release 4.5.3 I introduced a workaround to this problem.
The release should be available in a few minutes.

Could you please give it a try?

All good! Thank you for the quick fix (work around).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hannahchan picture hannahchan  路  3Comments

jpedretti-ciandt picture jpedretti-ciandt  路  3Comments

nilfdev picture nilfdev  路  5Comments

daniel-white picture daniel-white  路  3Comments

wsugarman picture wsugarman  路  4Comments