Select the product you need help with
A System.Resources.MissingManifestResourceException exception occurs when you try to access a localized resourceArticle ID: 839861 - View products that this article applies to. On This PageSYMPTOMSIn a Microsoft ASP.NET application, when you try to access a
localized resource, a System.Resources.MissingManifestResourceException exception may occur, and your Web browser may display an error
message that is similar to the following error message: Server Error in '/MyApp' Application. Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "MyApp.strings.resources" was correctly embedded or linked into assembly "MyApp". baseName: MyApp.strings locationInfo: <null> resource file name: MyApp.strings.resources assembly: MyApp, Version=VersionNumber, Culture=neutral, PublicKeyToken=null Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "MyApp.strings.resources" was correctly embedded or linked into assembly "MyApp". baseName: MyApp.strings locationInfo: <null> resource file name: MyApp.strings.resources assembly: MyApp, Version=VersionNumber, Culture=neutral, PublicKeyToken=null
CAUSEThis problem occurs if you use a localized resource that
exists in a satellite assembly that you created by using a .resources file that
has an inappropriate file name. This problem typically occurs if you manually
create a satellite assembly. To manually create a satellite assembly, you must first run the Resource File Generator (Resgen.exe), and then you must run the Assembly Linker (Al.exe). When you run Resgen.exe, if you do not specify the file name of the output file while you convert an XML-based resource format (.resx) file to a .resources file, Resgen.exe creates a .resources file that has the same file name as the input file. If the file name of your XML-based resource format file does not start with the namespace name of your application, the file name of the .resources file will not contain this namespace name either. You may run Al.exe to create a satellite assembly that contains the localized resources that exist in the .resources file. However, when you try to access a localized resource that exists in the satellite assembly, the behavior that is mentioned in the "Symptoms" section occurs. WORKAROUNDTo work around this problem, specify the file name of the
.resources file when you run Resgen.exe. While you specify the file name of the
.resources file, make sure that the file name starts with the namespace name of
your application. For example, run the following command at the Microsoft
Visual Studio .NET command prompt to create a .resources file that has the
namespace name of your application at the beginning of the file name: Resgen
strings.CultureIdentifier.resx
MyApp.strings.CultureIdentifier.resources Notes
STATUS This
behavior is by design. MORE INFORMATIONSteps to reproduce the behavior
REFERENCESFor more information, visit the following Microsoft
Developer Network (MSDN) Web sites: Globalization Architecture for
ASP.NET http://msdn2.microsoft.com/en-us/library/aa478974.aspx
(http://msdn2.microsoft.com/en-us/library/aa478974.aspx)
MissingManifestResourceException Class http://msdn2.microsoft.com/en-us/library/system.resources.missingmanifestresourceexception(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/system.resources.missingmanifestresourceexception(vs.71).aspx)
Localization http://msdn2.microsoft.com/en-us/library/aa292137(VS.71).aspx
(http://msdn2.microsoft.com/en-us/library/aa292137(VS.71).aspx)
Resources in Applications http://msdn2.microsoft.com/en-us/library/f45fce5x(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/f45fce5x(vs.71).aspx)
Creating Satellite Assemblies http://msdn2.microsoft.com/en-us/library/21a15yht(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/21a15yht(vs.71).aspx)
Resource File Generator (Resgen.exe) http://msdn2.microsoft.com/en-us/library/ccec7sz1(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/ccec7sz1(vs.71).aspx)
Assembly Linker (Al.exe) http://msdn2.microsoft.com/en-us/library/c405shex(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/c405shex(vs.71).aspx)
PropertiesArticle ID: 839861 - Last Review: May 18, 2007 - Revision: 1.11
|


Back to the top








