I seem to have a strange issue - I get coverage data for 5/6 projects.
I have unit tests that run code in the 6th project and I don't see any coverage data. I see no errors on the console and no failed unit tests.
I made sure the project generates a pdb and the settings are for all 6 projects identical as I am using directory.build.props to make the settings consistent. Is there any diagnostic information I can get to see why the 6th project is not getting coverage data?
using mstest vs 2017 / coverlet.msbuild 2.5.1 / unit test project is netcore 2.1 / dependency projects are net standard 2.0
Have you tried to run only for that project with include filter?We've an open issue on similar issue.
@abbotware can you please paste the terminal output from your test run
I have a issue on my project where in appveyor and Azure pipelines the coverage document is not generated because it cannot find symbols for a xunit package for some odd reason. I even filed a issue in opencover thinking it was related to opencover.
https://github.com/AraHaan/XmlAbstraction/
mind pointing me in the direction to fix this issue so I can get coverage report messages on pull requests again? Thanks in advance.
For me missing coverage for one project but not others was solved by adding this parameter to the dotnet test command: /p:CopyLocalLockFileAssemblies=true
Thanks! I can confirm that using
/p:CopyLocalLockFileAssemblies=true
works!
@abbotware feel free to close this issue if solved!
Thanks a lot @zmhh for help!
I think this should be added to the docs (if it is not already there) as I think this is a common issue.
Shouldnt this doc be updated with a small blurb about this additional command line parameter?
https://github.com/tonerdo/coverlet/blob/master/Documentation/MSBuildIntegration.md
I think this is a common issue.
After some search I found other issue like this...btw I would like to try to understand if it's possible understand when/if that parameters is needed and maybe tell to user on output.
So I'd like to repro on my local...someone can provide a repro of issue?
well for me, i have a project that references this nuget: Microsoft.Azure.ServiceBus
The following error appears without CopyLocalLockFileAssemblies=true
[coverlet] Unable to instrument module: ..\UnitTests\bin\Debug\netcoreapp2.1\Core.Messaging.dll because : Failed to resolve assembly: 'Microsoft.Azure.ServiceBus, Version=3.4.0.0, Culture=neutral, PublicKeyToken=7e34167dcc6d6d8c' [..\UnitTests.csproj]
When I originally reported the issue, there was no error message - so there have been some improvement / diagnostics - Adding 'you may need to set CopyLocalLockFileAssemblies=true' as a part of the error message might be good too.
Related issue https://github.com/dotnet/cli/issues/12705