Hi,
I am using Visual C#.NET (2003 Env., Framework 1.1)
I wrote a custom control which seems to work just fine except that if I try
to add it to another form I get the following exception:
An exception occurred while trying to create an instance of
SPMInterface.CoarseApproachStepCalibrationCtl. The exception was "The type
serialized in the .resources file was not the same type that the .resources
file said it contained. Expected "SIUnitsLibrary.SIValue" but read
"SIUnitsLibrary.SIValue".".
SPMInterface.CoarseApproachStepCalibrationCtl is the control that it can't
add. SIUnitsLibrary.SIValue is a class that is used both in that control and
in the form I am trying to add the control to.
If I manually add the control to the form (in the code) and then run the
application, the control shows up and works just fine. But as soon as I go
back into design mode and try to view the form in the designer it gives me
this exception and (VERY ANNOYINGLY!) rips out the code that I wrote in to
load the control.
Any ideas what might be wrong? I've had the designer rip out custom
controls before, for example, if they try to reference something which isn't
initialized at design time and hence throws an exception. This is not the
case here, and I have no idea what this exception means or how to fix it.
Thanks,
Eric