Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

MissingManifestException on Forms in subfolder when converting a WinForms project from VS2008 to VS2012

$
0
0

Hello,

I am having some run-time problems converting a windows forms project that was written in Visual Studio 2008 to Visual Studio 2012. The conversion happens without incident, our projects compile and run just fine but as soon as we try to show one of our forms, we receive a MissingManifestException. The full error is as follows:

"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.  Make sure "RootNamespace.FormName.resources" was correctly embedded or linked into assembly "AssemblyName" at compile time, or that all the satellite assemblies required are loadable and fully signed."

In researching this issue online, I seem to see a lot of references to the following knowledge base entry:
http://support.microsoft.com/kb/318603?wa=wsignin1.0

(I apologize for not making the above a link. My account is still in the process of being verified).

However, our forms are always the first class that appears in the .h file, and so unfortunately this is not the solution to our problem.

Further research reveals that this error only occurs on forms that exist in a subfolder and have some sort of image resource, an icon for example. Forms that exist in the same directory as the project file, or that have no image resources, pop open without issue. It seems that the intermediate file being generated is not "RootNamespace.FormName.resources" as was the case in VS2008, but is instead "RootNamespace.Subfolder.FormName.resources".

This issue is super easy to reproduce. Just create a new Windows Forms project (C++/CLI) in VS2008. Then, in Windows Explorer, in the project's folder create a new subfolder called "Forms". Create a new from in the Forms subfolder (note that VS2008 wants to put the .resx file in the project's folder, not the subfolder with the .h and .cpp. You'll have to move that manually). Give your new form an icon other than the default icon, then put a button on the main form that shows your new form. Now, save everything and close VS2008. Open your project in VS2012, convert it, and run it. As soon as you click your button to show the form in the subfolder, you should get this error.

Has anyone encountered this issue, or does anyone have a solution to it? I've played with it for a few hours and was able to come up with a few possible solutions. For example, changing the namespace that the form resides in from "RootNamespace" to "RootNamespace::Subfolder" seems to get around the problem (in 2012. Just causes the problem in 2008). Or, moving the form files out of the subfolder into the folder with the project file seems like it takes care of it as well. Naturally, I'd really prefer that we didn't have to alter our code in order to get our forms to show in VS2012. I'd really appreciate any help that anyone can offer on this matter.

If anyone requires them, I can post more detailed steps to reproduce this. If there is some way I can attach a .zip to my posts then I could create a project in VS2008 that would reproduce the issue as soon as you convert it to 2012.

Thank you for your time and help, I look forward to hearing from the community.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>