Somehow today when I input:
try {} catch {}
I get this:
try
{
}
catch (global::System.Exception ex)
{
}
But it should be just:
try
{
}
catch (Exception ex)
{
}
What happens? How I can back to Exception?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following progam results in
global::System.Exceptionif you place the cursor between the braces for theMainmethod and typetryand press [TAB] twice, i.e. triggering the code snippet for a try/catch.Therefore – do you have a class called
Exceptiondefined somewhere in your project / referenced assemblies, or do you define a top-level namespaceSystem? One of these, or a combination could cause this. Also note that the code sample lists nousingstatements so that could be a contributing factor.Not having the custom type called
Exceptionpresent results in thecatchbeingcatch (System.Exception)so I think it’s quite a specific scenario that causes this.