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

  • SEARCH
  • Home
  • 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 916183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:00:28+00:00 2026-05-15T18:00:28+00:00

I have a simple try/catch block try { // Open the connection _connection.Open(); //

  • 0

I have a simple try/catch block

try
{
     // Open the connection
     _connection.Open(); // [1]
}
catch( OracleException ex ) // [2]
{
     // Handle the exception
     int x = ex.ErrorCode;
}

The catch is never executed and the runtime reports ‘OracleException was unhandled’ at [1] which just makes my head spin. Clearly, I have a catch statement for the associated exception type. I’ve even tried the fully qualified type, Oracle.DataAccess.Client.OracleException at [2] and still the exception is unhandled.

The only way I can actually get the catch to work is by catching System.Exception at [2]. What is causing this odd behavior?

  • 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-05-15T18:00:29+00:00Added an answer on May 15, 2026 at 6:00 pm

    Are you dynamically loading assemblies at all, possibly using Assembly.LoadFrom or something similar? If so, you might be hitting a situation where the type that you have mutiple types loaded into different load contexts.

    Assemblies loaded into different context present the same types with different identities so they do not match type equality checks etc.

    From MSDN

    • The load context contains assemblies
      found by probing: in the GAC, in a
      host assembly store if the runtime is
      hosted, or in the ApplicationBase and
      PrivateBinPath of the application
      domain. Most overloads of the Load
      method load assemblies into this
      context.

    • The load-from context contains
      assemblies for which the user
      provided a path not included in the
      directories searched by probing.
      LoadFrom, CreateInstanceFrom, and
      ExecuteAssembly are examples of
      methods that load by path.

    Of course this is just a guess, so I might be wrong.

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

Sidebar

Ask A Question

Stats

  • Questions 488k
  • Answers 488k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As I guess you are fully aware, you need to… May 16, 2026 at 8:45 am
  • Editorial Team
    Editorial Team added an answer Try this. To enter the ^M, use ctrl-v enter. :g/^A/normal… May 16, 2026 at 8:45 am
  • Editorial Team
    Editorial Team added an answer Well, I got it. I need to pass parameters to… May 16, 2026 at 8:45 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a try catch block to handle an error I am getting with
I have a block of code that runs within a TransactionScope and within this
I am reading C# article.It suggests that At the end of the catch block,
I have a simple web service operation like this one: [WebMethod] public string HelloWorld()
So I have a simple socket server on an android emulator. When I'm only
I have the following simple scenario: A DialogForm with a Button, the Button_click throws
I have a piece of code like this try { RegistryKey regKey = Registry.LocalMachine.CreateSubKey(SOFTWARE\\xxxx\\yyyyy);
I have a simple question hopefully - how does one free memory which was
I have this simple script: $files = dir .\configs | ? { !$_.PSIsContainer }
There is probably is simple fix for this but I currently have code similar

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.