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 53647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:05:46+00:00 2026-05-10T17:05:46+00:00

I might be missing something obvious but is there a reference somewhere about what

  • 0

I might be missing something obvious but is there a reference somewhere about what exceptions are thrown by functions in .NET and why the exception might be thrown?

As an example, I was recently trying out Linq in Visual C# 2008 and I was loading an XML file into an XDocument. It was only through testing that I realised that if you try to load a file that doesn’t exist, it will throw a FileNotFound exception, but if you try to load a directory instead of a file you’ll get an UnauthorizedAccessException. Also looking through the System.IO namespace I can see things like a FileLoad exception and a PathTooLongException, and I can guess when they might be thrown but there could be others out there that might be thrown in some circumstance I haven’t thought of yet.

The only solution I’ve got right now is just to catch the ones I know about and then catch the Exception type, but I would rather be able to know exactly which types of exceptions I’m most likely to run into and why. I would have thought the MSDN library would have this type of information, but I can’t find it anywhere. Am I just blind? Is this information anywhere else?

EDIT: Some more specifics, right now I’m looking for the exceptions that might be thrown by the XDocument.Load(string) function. It looks like there is nothing relevant in the online documentation or the object browser. Do I now have to just run some tests and see what I run in to?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T17:05:47+00:00Added an answer on May 10, 2026 at 5:05 pm

    Nice question, you have 20/20 vision. C#/.NET does not implement the throws statement (i.e., checked exceptions).

    Anyone coming from a language such as Java is likely to wonder about this.

    Anders Hejlsberg, the father of C#, explains the rationale behind leaving checked exceptions out of C# in this article/interview. It’s a good read.

    From that article, Anders says:

    The concern I have about checked exceptions is the handcuffs they put on programmers. You see programmers picking up new APIs that have all these throws clauses, and then you see how convoluted their code gets, and you realize the checked exceptions aren’t helping them any. It is sort of these dictatorial API designers telling you how to do your exception handling. They should not be doing that.

    So, as Mitch and monoxide have said, MSDN documentation for the .NET FCL lists exceptions relevant to each class and also exceptions possible within each namespace.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer it works (roughly) like how a dict works in python:… May 13, 2026 at 11:02 pm
  • Editorial Team
    Editorial Team added an answer Find below the steps that solved my problem: Delete ASP.NET… May 13, 2026 at 11:01 pm
  • Editorial Team
    Editorial Team added an answer If your VB6 application is called MyApp.exe then the config… May 13, 2026 at 11:01 pm

Related Questions

I need to generate a WCF proxy for a service exposed by our client.
I have a series of controls on an ASP page. Some are inside an
I'm using an NSArrayController , NSMutableArray and NSTableView to show a list of my
Hopefully this example will illustrate my point better than simply trying to explain it:

Trending Tags

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

Top Members

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.