-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Code coverage empty on NET8.0 WPF project #1713
Comments
Please provide a repo for analysis. I not able to reproduce the exception. |
I have created a repo for this issue. https://github.com/modmynitro/coverlet-test |
Thank you for the repo. I updated the target framework and used net48 which solved the problem. steps:
TestProject\TestProject.csproj
TestProjectTests\TestProjectTests.csproj
coverage.cobertura.xml
|
I want to use |
OK. I will investigate (debug) this issue in the next days. |
The test project targeting net8.0-windows need the property Unfortunately this is not documented anywhere but a hint shall be added for coverlet.msbuild and coverlet.collector. Solution:
Results:
|
I can use this solution as workaround, but we only use I would expect the runtime assemblies to be found automatically. |
Describe the bug
Code Coverage on NET8.0 WPF project is empty.
To Reproduce
Create a .NET8 WPF project and refrence an enum value out of 'PresentationFramework' as default value.
Create a test project with an arbitrary test and run
dotnet test --configuration Debug --collect:"XPlat Code Coverage"
.Expected behavior
Code coverage should not be empty.
Actual behavior
The resulting coverage is empty.
When executing:
dotnet test .\TestProject.sln --configuration Debug --collect:"XPlat Code Coverage" --diag:log.txt
The
log.datacollector.***.txt
contains following exception:Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used? =>
6.0.2
also tested6.0.3-preview.17.g302886a430
* Which version of .NET is the code running on? =>
net8.0-windows
andnet9.0-windows
* What OS and version, and what distro if applicable? =>
Microsoft Windows 10 Enterprise 19045
* What is the architecture (x64, x86, ARM, ARM64)? =>
x64
* Do you know whether it is specific to that configuration? => no
Additional context
Adding
<PreserveCompilationContext>true</PreserveCompilationContext>
did not help.Adding
/p:CopyLocalLockFileAssemblies=true
did also not help.The text was updated successfully, but these errors were encountered: