Wednesday, May 7, 2014

A System.Resources.MissingManifestResourceException exception occurs when you try to access a localized resource

Problem:
I broke my phone app out into different projects and now have BLL logic in a separate project.  I created a windows phone class library but it did not include the ever handy resources file in the template.  I foolishly copied and pasted from another project into the new project.  I ended up with this error.  This caused me to do some research into this as of yet unknown area to me. 

The resources file was designed primarily to be used for interationalizing projects.  You can create a resource file for each culture in your project.  This way you can share the same enumerations across the project and simply load the page with the resource which matches the culture of the persons brower. 

My mistake was to try and create this by copy and paste.  If you want to do this manually then microsoft provides great instructions on building Satellite assemblies.



The following Al.exe command creates a satellite assembly for the application MyApp from the file strings.de.resources.

al /t:lib /embed:strings.de.resources /culture:de /out:MyApp.resources.dll

Solution:
I simply dropped the resources file and use the add resource element to the project in question.



Source:

http://support.microsoft.com/kb/839861
Creating Satellite Assemblies
http://msdn.microsoft.com/en-us/library/21a15yht(v=VS.100).aspx


No comments:

Post a Comment