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.

Sugestion:

Reference:
Why aren't the existing options offered by VS for controlling when the exception dialog is shown sufficient for you?
Also, does the behavior improve if you use foreach instead of ForEach?
Example:

This issue lacks enogh information to be actionable.
@CyrusNajmabadi
Do you have any models that I can follow to publish something more complete here?
@svick
No, because with settings in the VS gets on the machine on the user and when shared the project will start to give numerous errors on the machine of another programmer, with these #pragma gets more declarative that there has an exception that burst in the first try/cath Previous, this functionality would be very useful for lambdas.
No, because with settings in the VS gets on the machine on the user and when shared the project will start to give numerous errors on the machine of another programmer,
Why is that a problem? How debuggers work is entirely up to the individual. If i choose to use windbg, i want to have control over that experience. If someone else wants to use a debugger present in their IDE, that is up to them.
would be to disable this warning that Visual Studio and continue the Code because it is an exception that has already been handled.
You can just use a boolean for this:
c#
try
{
// ...
}
catch (Exception e)
{
if (!shown)
{
shown = true;
_alert().Show(e.Message);
}
}
Now you'll only ever report that exception handler once.
@CyrusNajmabadi
Good if you want to do with activators like Boolean that gets a dirty and great code all right just got another point of view that would be very useful a #pragma to disable exception of a specific snippet of my code, do not want to disable my entire project.
Good if you want to do with activators like Boolean
I'm having trouble understanding what you're trying to say here.
It sounds like you think this is a good solution. If so... great! It doesn't look like we need language changes for this.
that would be very useful a #pragma to disable exception of a specific snippet of my code
What does it mean to "disable exception"? Do you mean: the exception won't be thrown? Or do you mean: the debugger won't report the exception?
I'm using a translation tool, the debugger will not report the exception in that specific code block.
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.
the debugger will not report the exception in that specific code block.
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:
