Skip to content

Commit d4f2352

Browse files
committed
Coverlet 8 has a bug that prevents it from generating coverage for .NET Framework projects, possibly related to the version of .NET (Core) installed on the computer, and the comments in coverlet-coverage/coverlet #1818 and #1812 are very confusing about whether .NET Framework is even still supported, or how to make it work, or why it regressed, or when it will be fixed, especially when issues are being closed despite users reporting that the latest preview builds don't fix the issue and continue to crash, and then the issue just gets closed with a link to an irrelevant, unhelpful Microsoft documentation page that's unrelated to the problem and doesn't fix anything.
1 parent e51d8fe commit d4f2352

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/dotnetframework.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
# build again in Debug mode just for tests because Release tests would have duplicate dependencies as ILRepacked release code under test, causing error CS0433: The type 'LogLevel' exists in both 'Fail2Ban4Win, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' and 'NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' [D:\a\Fail2Ban4Win\Fail2Ban4Win\Tests\Tests.csproj]
3333
- name: Test
3434
run: |
35-
msbuild -p:Configuration=Debug -t:build -m
36-
dotnet test --no-build --verbosity normal --configuration Debug --collect:"XPlat Code Coverage" --settings Tests\Tests.runsettings --logger "trx;LogFileName=TestResults.xml"
35+
msbuild Tests -p:Configuration=Debug -t:build -m -verbosity:minimal
36+
dotnet test Tests --no-build --verbosity normal --configuration Debug --collect:"XPlat Code Coverage" --settings Tests\Tests.runsettings --logger "trx;LogFileName=TestResults.xml"
3737
Out-File -InputObject "TEST_EXIT_CODE=$LASTEXITCODE" -FilePath $env:GITHUB_ENV -Append -Encoding UTF8
3838
Copy-Item Tests/TestResults/*/coverage.info Tests/TestResults -ErrorAction Continue
3939
exit 0

Tests/Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
<PropertyGroup>
44
<TargetFramework>net472</TargetFramework>
5+
<LangVersion>latest</LangVersion>
56

67
<IsPackable>false</IsPackable>
7-
8-
<LangVersion>latest</LangVersion>
8+
<IsTestProject>true</IsTestProject>
99
</PropertyGroup>
1010

1111
<ItemGroup>
@@ -19,7 +19,7 @@
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
<PrivateAssets>all</PrivateAssets>
2121
</PackageReference>
22-
<PackageReference Include="coverlet.collector" Version="8.0.0">
22+
<PackageReference Include="coverlet.collector" Version="[6.0.4,8)">
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2424
<PrivateAssets>all</PrivateAssets>
2525
</PackageReference>

0 commit comments

Comments
 (0)