System.IO.FileNotFoundException error when accessing My.Resources

  • Thread starter Thread starter sh
  • Start date Start date
S

sh

I have a resource called "Location". When I try to access it with the
statement

If My.Resources.Location = "Office" ...

I get the following error message:

A first chance exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll

Why? Isn't the resource part of the application?

How can I avoid this error (except with a Try...Catch statement).
 
You cannot use that statement, because Resources are read-only.

My.Resources.Location should be your resource and remember to use the
data as its meant to (Dont try stupid things like msgbox'ing a bitmap
like i have done in the past).

If you want to have something be able to change, add it to the Settings
instead.
 
Back
Top