BUG: "System.Resources.MissingManifestResourceException" error message after you change the name of a localized form class in Visual C++ .NET 2003 (839298)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
- Microsoft .NET Framework 1.1
SUMMARYThis article discusses a bug in Microsoft Visual C++ .NET 2003. When you change the name of a localized form class in a Windows Forms Application (.NET) project, and then you run the project, you receive a "System.Resources.MissingManifestResourceException" exception error message. This article describes how to work around this problem by correcting the Resource File Name property. SYMPTOMSWhen you change the name of a localized form class in a Windows Forms Application (.NET) project in Visual C++ .NET 2003, and then you run the project, you receive the following error message: An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure
"MyForm.resources" was correctly embedded or linked into assembly "Q839298".
baseName: MyForm locationInfo: Q839298.MyForm resource file name: MyForm.resources assembly: Q839298, Version=1.0.1546.20800, Culture=neutral,
PublicKeyToken=null Note In this error message, Q839298 is a placeholder for the namespace name of your application, and MyForm is a placeholder for the class name of your form class that you localized. CAUSEThis problem occurs because you changed your localized form class name in various places, but you did not change the Resource File Name property of the .resX file of the project. Therefore, the code to create the ResourceManager object looks for the resources file in the form of Q839298.MyForm.resources, while you generate Q839298.Form1.resources.
Note Q839298 is a placeholder for the namespace name of your application, and MyForm is a placeholder for the class name of your form class that you localized.RESOLUTIONTo work around this problem, change the Resource File Name property of the .resX file of the project. To do this, follow these steps: - Start Visual Studio .NET 2003.
- Open the project that contains the localized form class where you receive the error message that is mentioned in the "Symptoms" section.
- In Solution Explorer, expand all folders.
- Right-click Form1.resX, and then click Properties.
- In the Form1.resX Property Pages dialog box, expand Configuration Properties, and then click General under Managed Resources.
- Change the Resource File Name property from $(IntDir)/Q839298.Form1.resources to $(IntDir)/Q839298.MyForm.resources, and then click OK.
Note Here Q839298 is a placeholder for the namespace name of your application, and MyForm is a placeholder for the class name of your form class that you localized. - Press CTRL+SHIFT+S to save the project.
- Press CTRL+SHIFT+B to build the solution.
- Press F5 to run the application. The application runs, and the Form1 form is displayed.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 12/29/2005 |
---|
Keywords: | kbWindowsForms kbResX kbResource kbNameSpace kbForms kbProperties kbLocalization kberrmsg kbcode kbbug KB839298 kbAudDeveloper |
---|
|