question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception filters appear on the wrong line

See original GitHub issue

Steps:

dotnet tool install --global dotnet-reportgenerator-globaltool
git clone https://github.com/hughbe/wpf
cd wpf
git checkout coverlet
dotnet test ./src/Microsoft.DotNet.Wpf/test/System.Xaml /P:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./coverage.xml /P:ExcludeByAttribute=ExcludeFromCodeCoverageAttribute
reportgenerator -reports:./coverage.xml -targetdir:./coverage

Expected

  • Exception filters coverage is on the right line

Actual

  • Exception filters are on the wrong line

See for example L1349 of the coverage for XamlSchemaContext.cs image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
MarcoRossignolicommented, Jan 23, 2019

Hi guys, I’m working on other issues at the moment, if no one solve this meanwhile I’ll take a look.

0reactions
pape77commented, Feb 18, 2019

@MarcoRossignoli You mean like this? (It’s the same code of my previous image, now fixed)

screen shot 2019-02-18 at 12 09 09

What I ment for tests was this (this is how i have it in my fork):

 // arrange
            var type = _module.Types.Single(x => x.FullName == typeof(ExceptionFilter).FullName);
            var method = type.Methods.Single(x => x.FullName.Contains($"::{nameof(ExceptionFilter.Test)}"));

So using Single istead of First for _module.Types and _type.Methods

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Why exception filters are preferable to catching and ...
Exception filters are preferable to catching and rethrowing because they leave the stack unharmed. If the exception later causes the stack to ...
Read more >
The throw keyword shows the wrong thrown exception line
The filters give you even better diagnostic experience because of the crash dump will have the stacktrace of the original throw site preserved....
Read more >
Exception filters in C# 6: their biggest advantage is not what ...
In the code with exception filters, on the other hand, the filter won't match, so the catch block won't be entered at all,...
Read more >
The good and the bad of exception filters - .NET Blog
The key is to only read information from either the exception object itself, or from immutable global state, and to not change any...
Read more >
Exception filters | NestJS - A progressive Node.js framework
Exception filters. Nest comes with a built-in exceptions layer which is responsible for processing all unhandled exceptions across an application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found