Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

  • Administrators
Posted

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?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...