1

I have a wince application and am getting the following error message sometimes:

An error message cannot be displayed because an optional resource assembly containing it cannot be found

This is because I don't have the dll of exception messages installed (system.sr.dll). The problem is that I would like to make a multi-language image containing the error messages for all languages, but system.sr.dll is only in one language.

Is there a way to find out what exception was thrown without having system.sr.dll installed, then lookup the error message from a multi-language exception message dictionary that I have built? I'm not terribly familiar with debugging the device, so I'm not sure what I have to work with (if anything).

Thanks, Mark

MStodd
  • 4,716
  • 3
  • 30
  • 50

1 Answers1

1

Syste.SR.dll only contains the localized exception texts and I'd argue you shouldn't be showing that to a user anyway. Users don't understand obscure development-focused messages.

The Exceptions themselves are still typed, so you can still catch based on type information and display a meaningful message to the user. The meaning of an exception is very context-driven based on what the user, or your app, was trying to do at the point of the exception.

Something like this is generally useless and unfriendly for a user:

NullRefrenceException occurred at foo.bar.baz

You should be trapping it with a try/catch and then "converting" it to something specific to your app, like:

A valid customer name must be provided

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • Good point. Now I just need to figure out what types to catch. To do some debugging, I did make a simple app that I can debug in the emulator. Although I can't stop it from deploying system.sr.dll, I should have all I need. – MStodd Mar 14 '12 at 21:42