OK, say I have an application like this:
using System;
using AliensExist; // some DLL which can\'t be found...
What I want is that if the
You can't really do that in a try/catch, but what you can do is handle the AssemblyResolve
event on the AppDomain.
See http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx for further details.
However, you will at least need to get your code compiling. If you are trying to "reference" an assembly which may or may not exist, you will need to dynamically load it and work from there.