95se5m Posted October 31, 2005 Posted October 31, 2005 I searched and found nothing helpful so I thought I would ask. I have a form that uses the System.Reflection class to get the version number of a number of my dependency files. The problem is that is one is missing (multi use app, some files not needed when installed in some modes) the whole form and attached app dies, but try catch statements are not alowed at module level where I am creating the assemblies. Is there any way to keep these at module leve and still trap and handle errors? Quote
Administrators PlausiblyDamp Posted October 31, 2005 Administrators Posted October 31, 2005 Could you post some code to give a better idea of what the problem is as I'm not sure how (or more importantly why) you are creating an assembly at the module level, if you want to handle the error then you will need to do this from inside a subroutine. Also you might be better off using a class rather than a module at least then you could put the initialisation into a shared constructor. Rather than using exceptions would it not be easier to check for the existance of the library before trying to load it? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.