Hi,
I'm having a problem with some custom forms I developed. This form worked perfectly with VS2008, but is causing an error with VS2010. Going back to VS2008 is a worst case scenario option for various reasons.
Anyway the problem -
When I try to view a form of type FormWithError in design mode I get the standard "To prevent possible data loss before loading the designer, the following errors must be resolved/ignore and continue" screen. If I ignore and continue I can then see the form. Two warnings are written to the error list (more on this below).
The class hierarchy looks like this.
FormWithError inherits BaseFormB inherits BaseFormA inherits Windows.Forms.Form
BaseFormA contains a standard Windows ErrorProvider object. The ErrorProvider object has a Protected modifier (changing it to Public didn't fix the problem) and is used on BaseFormB and FormWithError.
The warnings read: The method or operation is not implemented and point to the BeginInit & EndInit calls in the .designer file.
CType(Me.ErrorProvider, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ErrorProvider, System.ComponentModel.ISupportInitialize).EndInit()
If I delete these lines the error goes away and I can go straight to design view without an error. However if I change the form visually in anyway these two lines are obviously written back to the .designer file.
The call stack for both warnings is the same -
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkPropertyInfo.get_RuntimeProperty()
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkPropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at Microsoft.VisualStudio.Shell.Design.PropertyInfoWrapper.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.PropertyInfo.GetValue(Object obj, Object[] index)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyReferenceExpression(IDesignerSerializationManager manager, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
Any ideas on what the problem might be?
Thanks