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.63k stars 283 forks source link

`dotnet test --configuration release` exception with 4.2.17 #279

Closed daniel-white closed 5 years ago

daniel-white commented 5 years ago

I am running with dotnet test --configuration release in .net core 2.1.

The short switch '-property:Configuration=release' is not defined in the switch mappings.
   at Microsoft.Extensions.Configuration.CommandLine.CommandLineConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at Palmmedia.ReportGenerator.Core.Generator.GetConfiguration() in d:\a\1\s\src\ReportGenerator.Core\Generator.cs:line 270
   at Palmmedia.ReportGenerator.Core.Generator.GenerateReport(IReportConfiguration reportConfiguration) in d:\a\1\s\src\ReportGenerator.Core\Generator.cs:line 42

Here's how I'm including it in my targets file:

  <PropertyGroup Label="Coverlet Options">
    <!-- See https://github.com/tonerdo/coverlet for more options -->
    <!-- TODO <CollectCoverage>true</CollectCoverage> -->
    <CoverletOutput>$(MSBuildProjectDirectory)\..\gen\test-coverage\$(MSBuildProjectName)\</CoverletOutput>
    <CoverletOutputFormat>lcov,json,opencover</CoverletOutputFormat>
    <Threshold>15</Threshold>
    <Exclude>$(Exclude),[xunit*]*</Exclude>
    <Include>$(Include),[$(AssemblyName.Replace(".UnitTests", ""))]*</Include>
    <ExcludeByFile>$(ExcludeByFile),$(MSBuildThisFileDirectory)/src/*</ExcludeByFile>
    <ExcludeByAttribute>$(ExcludeByAttribute),GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
  </PropertyGroup>

  <Target Name="GenerateCoverageReport" AfterTargets="GenerateCoverageResult">
    <ItemGroup>
      <CoverageFiles Include="$(CoverletOutput)\*.xml" />
    </ItemGroup>
    <ReportGenerator ReportFiles="@(CoverageFiles)" TargetDirectory="$(CoverletOutput)\html" ReportTypes="Html" />
  </Target>

dotnet test works appropriately.

danielpalme commented 5 years ago

Will have a look at the problem within the next 1-2 days.

Minimum project to reproduce issue: Sample.zip

danielpalme commented 5 years ago

Release 4.2.19 should be available in a few minutes. Could you please try again?

daniel-white commented 5 years ago

looks good. thanks.