What would cause my application to lose access to the resource (.resx) file

Winforms c# application running on terminal server. All images for buttons and menu items are stored as resources in the .resx file. After some heavy use, opening and closing windows while using the system, an "index out of range" exception is thrown and the window no longer opens. If the user attempts to navigate to any other part of the system it fails for the same reason. Narrowed it down to the resources not being able to be loaded anymore.

Does anyone have an idea of what may cause this or how I might be able to avoid it? Should I use a different method for storing my images to be used for my application?

Additional information: turns out the user was receiving a "Parameter is not valid" exception rather than an index out of range.

Answers


It is strange that you receive an out-of-range exception when accessing resources, mainly because the resources are not stored in any kind of collection, there are accessed as properties, so perhaps your exception does not come from there?

Plz provide some code about the way you are retrieving the images/buttons.


Are you releasing the resources after you use them? It sounds like you're running out of resource handles (and the exception you're seeing may be a red herring).


Need Your Help

Combining solve and dsolve to solve equation systems with differential and algebraic equations

matlab differential-equations

I am trying to solve equation systems, which contain algebraic as well as differential equations. To do this symbolically I need to combine dsolve and solve (do I?).

Visual Studio 2010: very slow web applications debugging!

visual-studio-2010 visual-studio debugging

I recently installed Visual Studio 2010 (Ultimate edition, final version released in April), and found that debugging a web application became very slow (2-3 times slower than in Visual Studio 2008...