Can VS2005 catch exceptions in external dll-s?
-
If I do something like this: int i = Convert.ToInt32("asdfas"); without the try/catch block and start a program with the above line in VS2005, the IDE will catch the exception, show the appropriate message and position to the problematic line. On the other hand, if I have an assembly that is loaded at run-time, for instance like this: a = Assembly.Load(strAssembly); Type ObjectType = a.GetType(strClass); object obj = Activator.CreateInstance(ObjectType); MethodInfo mi = ObjectType.GetMethod("SomeMethod", pars); mi.Invoke(obj, null); and there is an unhandled exception somewhere in the assembly, VS2005 will not catch that exception (even if assembly is compiled as DEBUG and can be debugged into) but instead 'mi.Invoke' will exit with generic exception 'exception has been thrown by the target of the invocation'. Is there a way for VS2005 to catch these exceptions and position to problematic line like it does with non run-time loaded assemblies? Dragan Matic