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.

C# new preprocessor directives "#pragma exception before"

See original GitHub issue

2.1.403:

Steps to Reproduce:

New implementation

Expected Behavior:

#pragma exeception before

This is the normal situation that we all know today, I did a treatment with an alert ja and when I give an exception within a delegate that execption of a warning in Visual Studio the #pragma would be to disable this warning that Visual Studio and continue the Code because it is an exception that has already been handled.

47243054-3a029300-d3c7-11e8-9264-13c157a09ac0

Sugestion:

47243160-98c80c80-d3c7-11e8-9dee-b820527722b4

Reference:

https://github.com/dotnet/csharplang/issues/1936

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
CyrusNajmabadicommented, Oct 23, 2018

Ok. So it sounds like this is purely a tooling request, and is unrelated to making changes to the language or adding pragmas.

For example, WinDbg gives a lot of control over exceptions: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/controlling-exceptions-and-events#span-idcontrollingexceptionsandeventsfromthedebuggerspanspan-idcontrollingexceptionsandeventsfromthedebuggerspancontrolling-exceptions-and-events-from-the-debugger

If you’d like the VS debugger to have support for some sort of “don’t actually pause for exceptions within this block” i recommend you file a VSFeedback item here:

image

1reaction
CyrusNajmabadicommented, Oct 23, 2018

I’m using a translation tool, the debugger will not report the exception in that specific code block.

I don’t understand your response. You stated:

that would be very useful a #pragma to disable exception

I’m tryin got understand what you mean by ‘disable exception’ Can you clarify? Note: if this is hard to explain here, you can go to gitter.im/roslyn and we can discuss things there. But right now, it’s not actually clear what you’re asking for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is #pragma considered a preprocessor directive?
Pre-processing is specifically a source to source translation before any compilation begins. Therefore #pragma warning must not be pre-processed ...
Read more >
C# preprocessor directives #pragma exception "disable ...
When placed #pragma he simply ignores continues because he knows he has a treatment before breaking the code.
Read more >
Pragma directives and the __pragma and _Pragma keywords
Describes the pragma directives available in Microsoft Visual C and ... a conditional directive, to provide new preprocessor functionality.
Read more >
pragma Directive in C/C++
This directive is a special purpose directive and is used to turn on or off some features. These types of directives are compiler-specific ......
Read more >
How to use the preprocessor directive ' #pragma ' in C ...
Best-practice for new code is to use -std=c23 (or -std=c2x until your compiler implements the C23 standard). Treat bool , true , and...
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