MissingManifestResourceException

10/13/10

MissingManifestResourceException

The other day I was creating a WinForms application, and it kept blowing up at runtime on a line that referenced Properties.Resources.SomeExistingResource with:

System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure “MyNamespace.Properties.Resources.resources” was correctly embedded or linked into assembly “MyApp” at compile time, or that all the satellite assemblies required are loadable and fully signed.

A fellow developer (Phil) and I figured it out, with help from a Stack Overflow article.

There’s a literal string in Resources.Designer.cs (under Properties/Resources.resx in Solution Explorer) that’s automatically updated based on the value of the Default Namespace in the project properties (Application tab) in Visual Studio 2010. Normally the namespace of this auto-generated Resources class is kept synchronized with this value. In my case I was using a custom project template, and apparently they got out of sync.

Timwi and others offer alternate solutions in the Stack Overflow article linked above. In my case I just had to change the Default Namespace to match the namespace in the file.


Your Host: webmaster@truewill.net
Copyright © 2000-2013 by William Sorensen. All rights reserved.