Resx losing resources?

D

Dave Veeneman

My form's resx file is losing resources that I have added with ResEditor.exe
(the utility that ships with VS.Net. Here is what is happening: I add the
icon to the .resx file with no problems. My app calls the resource, using
the following code:

System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(this.GetType());
this.Icon = (System.Drawing.Icon)resources.GetObject("Scenario.Icon");

The call works fine, but the icon is deleted from the .resx file. If I try
to call up the resource again, it's not found. I confirmed with
ResEditor.exe that the icon is no longer in the .resx file.

Can anyone tell me why this is happening? Thanks.

Dave Veeneman
Foresight Systems
 
D

Dave Veeneman

I think I found my answer. Resources were disappearing during debugging,
when the runtime threw an exception. I added a call to the Resource
Manager's ReleaseAllResources() method immediately after I read the icon,
and the problem went away.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top