Error Catch outside of a sub

95se5m

Newcomer
Joined
Oct 4, 2005
Messages
8
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?
 
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?
 
Back
Top