Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FCC Coverage doesn't include Project being tested #134

Answered by tonyhallett
hughball77 asked this question in Q&A
Discussion options

Hello!

I'm using VS Pro, trying to get some visual code coverage going and FCC seems to be what I'm looking for. I've got the latest extension installed (1.1.141) and it appears to be working, but the project I'm actually testing isn't appearing in the Coverage tab of the FCC, and therefore I don't get the actual sidebar code coverage highlighting that I'm looking for.

For example, I have two projects in my solution: Main and Main.Tests. Under Coverage, only Main.Tests shows up with the list of tests run.

Edit - I should note that my Main project is a .NET Framework 4.0 project, and my Main.Tests is a .NET 5.0 project.

Any suggestions of where I might start looking?

Thanks!

You must be logged in to vote

What does the FCC output window pane show ?

Replies: 1 comment 3 replies

Comment options

What does the FCC output window pane show ?

You must be logged in to vote
3 replies
Comment options

It's got a bunch of these:

Fine Code Coverage : ================================== START ==================================
Fine Code Coverage : Run Coverage Tool (Main.Test)
BadImageFormatException during MetadataReaderProvider.FromPortablePdbStream in InstrumentationHelper.PortablePdbHasLocalSource, unable to check if module has got local source.
Unable to instrument module: D:\----redacted----\Release\net5.0-windows\fine-code-coverage\build-output\----redacted---- because : AssemblyResolutionException for 'System.Diagnostics.EventLog, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Try to add <PreserveCompilationContext>true</PreserveCompilationContext> to test projects </PropertyGroup> or pass '/p:CopyLocalLockFileAssemblies=true' option to the 'dotnet test' command-line

But there's no reference to Main - it's almost like it's excluding it or it doesn't know it's there.

Comment options

^^ This might be my problem - I didn't realize that unable to instrument module was coming from my Main project. I'll sort that out and report back.

Comment options

I figured it out - it was two things:

  • following the unable to instrument module error, I added the System.Diagnostics.ErrorLog package to my dependencies
  • I had installed the FCC extension from the web, not directly from VS, which got me version 1.3.0 of coverlet.collector. Looking at my updates, 3.0.3 was available and I've now installed that

I've got code coverage highlighting where I was expecting it - thanks for being my sounding board and letting me think out loud!

Answer selected by hughball77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /