Catching FileNotFoundException

  • Thread starter Thread starter Dario
  • Start date Start date
D

Dario

Hi,

I'm wondering if there is a way to gracefully handle a FileNotFoundException.

The problem:

My C# application depends on C# dll (.Net assembly).

When the application starts, if, for any reason, this dll is missing, the
application throws a FileNotFoundException.

I would like to catch this exception in order to show a MessageBox but I'm
unable to find a way.

I tried to use AppDomain.UnhandledException and/or Application.ThreadException
events in Main() but Main() does not even "execute".

Do you know how this particular case can be handled ?

Thanks,

Dario
 
Back
Top