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.
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>
I am running with
dotnet test --configuration release
in .net core 2.1.Here's how I'm including it in my targets file:
dotnet test
works appropriately.