After converting a solution with lots of forms, user controls and resource files from 2003 to 2005 I get the following error when trying to view a form in the designer:
Failed to parse method 'InitializeComponent'. The parser reported the following error 'Error HRESULT E_FAIL has been returned from a call to a COM component.'. Please look in the Task List for potential errors.
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnMethodPopulateStatements(Object sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Statements()
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
When I look in InitializeComponent I see thatproperties that should beset to anempty string are being changed to reference a projectresource file (not the form resource) that happens to have an entry with an empty value. The error occurs because it assumes that there is a generated class for the resx files but since it was created in 2003 there isn't.
If I run the code generator for the resource file then the code will compile but you still end up with forms referencing a resource file that has nothing to do with the form.
Is there any way to stop the form designer code generator from replacing all the empty string properties with a call to an unrelated resource file?