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?