The type initializer for 'Coverlet.Core.Instrumentation.NetstandardAwareAssemblyResolver' threw an exception
See original GitHub issueRecently migrated to a new machine where I cannot seem to get code coverage tools working.
OS: Mac OS Platform: .NET Core
% dotnet --version
3.1.401
Test output:
% dotnet test path /p:CollectCoverage=true
Build succeeded.
"/Users/hkj/Projects/firebase-admin-dotnet/public/FirebaseAdmin/FirebaseAdmin.Tests/FirebaseAdmin.Tests.csproj" (VSTest target) (1:7) ->
(InstrumentModulesAfterBuild target) ->
/Users/hkj/.nuget/packages/coverlet.msbuild/2.6.3/build/coverlet.msbuild.targets(24,5): warning : [coverlet] Unable to instrument module: /Users/hkj/Projects/firebase-admin-dotnet/public/FirebaseAdmin/FirebaseAdmin.Tests/bin/Debug/netcoreapp2.0/FirebaseAdmin.dll because : The type initializer for 'Coverlet.Core.Instrumentation.NetstandardAwareAssemblyResolver' threw an exception. [/Users/hkj/Projects/firebase-admin-dotnet/public/FirebaseAdmin/FirebaseAdmin.Tests/FirebaseAdmin.Tests.csproj]
1 Warning(s)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
coverlet: Unable to instrument module (ArgumentException)
I faced an issue when some projects from solution (NOT ALL) are not being instrumented (have zero coverage, though have active unit tests)....
Read more >SOLVED the type initializer for module threw an exception ...
this error the type initializer for module threw an exception happened, when you installed upper version of .net framework. to solve this ...
Read more >Exception trying to instrument a .NET Framework assembly ...
In a .NET Framework project using a type from the System.Data.SqlClient namespace, coverlet attempts to instrument an assembly with that name. That fails...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok use last version 2.6.3 is pretty old 7/1/2019
Feel free to close if solved.
With v2.9.0 of the coverlet.msbuild package I seem to get a successful build (on .NET 3.1).
So this may be an issue with v2.6.0 on new version of .NET Core.
I’m running a pretty standard installation.