Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8643255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:59:17+00:00 2026-06-12T11:59:17+00:00

I am using some external code which when called with certain parameters throws an

  • 0

I am using some external code which when called with certain parameters throws an exception which can be ignored. Unfortunately I can not change this external code for various reasons.

I have created a wrapper method which looks something like this:

    [DebuggerStepThrough]
    public static bool TryGetXXX(string input, out string output)
    {
        try
        {
            output = MethodThatSometimesFails(input);
            return true;
        }
        catch
        {
            output = null;
            return false;
        }
    }

    private static string MethodThatSometimesFails(string input)
    {
        // Don't want this to cause a break
        // but can not put the attribute on this method
        throw new Exception("couldnt deal with your request");
    }

Unfortunately though, the external code will still break at the exception inside MethodThatSometimesFails. The [DebuggerStepThrough] will only avoid debugging the code above, but the called code will still throw.

What I would like is that the code just runs even with all of check boxes on the “Exceptions…” window checked. Is there an attribute which can do this?

If there is no attribute I could create a project containing these classes / methods and exclude the entire project. Is there a way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:59:19+00:00Added an answer on June 12, 2026 at 11:59 am

    Couldn’t find a solution for this. In the end the only option was to put the TryGet into another DLL!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have external html5 canvas that you can paint on some lines using your
I've inherited some code which uses Exchange Web Services to synchronize certain data between
Bellow is my code from asp.net service which is trying to run some external
I'm sending some data to an external URL using Curl. The server sends me
I'm trying to pullout some info from an external site using jQuery and Adobe
I'm using JSON to get some values into a variable from an external source.
I'm importing some images dynamically into a SWF from an external site using AS2.
Using some of the methods, I am able to check the orientations to which
I am using some easing functions in C# which give Ease In and Ease
I have been using some Javascript to create a text field once an certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.