I've searched StackOverflow and found similar problems when I try and open a form that references a UserControl in a different project.
I get the
To prevent possible data loss before loading the designer, the following errors must be resolved:
message relating to the following two errors:
Could not find type 'MyNamespace.CommonUi.InformationBox'. Please make
sure that the assembly that contains this type is referenced. If this
type is a part of your development project, make sure that the project
has been successfully built using settings for your current platform
or Any CPU.
AND
The variable 'InformationBox1' is either undeclared or was never
assigned.
InformationBox1
is an instance of the user control InformationBox
that is on the form in the designer - it's just referenced as;
Friend WithEvents InformationBox1 As MyNamespace.CommonUi.InformationBox
The MyNamespace.CommonUi
project builds successfully.
I get intellisense in the project so I'm reasonably confident that it's being referenced correctly.
So far, the same as other people have had:
This is a project that's been migrated from .NET2/x86 in VS2005 to .NET4/x64 in VS2012.
Now when the solution is running under 64 bit it doesn't work and I get this designer error. However, if I switch it to 32 bit (well technically AnyCPU) I can open the designer just fine.
I've read through the other suggestions in similar threads but they don't see to provide any solution (I've even gone as far as the "move it left & right to get it to rebuild" option)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…