Home Dashboard Directory Help
Search

Inherited WinForms UserControls unusable after modification by Karl Costenbader


Status: 

Resolved
 as Fixed Help for as Fixed


30
0
Sign in
to vote
Type: Bug
ID: 551677
Opened: 4/15/2010 7:44:42 PM
Access Restriction: Public
3
Workaround(s)
view
20
User(s) can reproduce this bug

Description

We have a core set of Windows Forms DLLs that provide UserControls that can be inherited and modified in different projects. Under previous Visual Studio versions, this inheritance and modification worked correctly. In Visual Studio 2010, when we open the designer for a modified UserControl, the exception "The method or operation is not implemented" is thrown numerous times with the following call stack:

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.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

We have tested this on a couple of different machines with the same results and have tried uninstalling and reinstalling VS2010 a couple of times to ensure that everything was installed correctly.
Details
Sign in to post a comment.
Posted by Microsoft on 1/25/2011 at 12:29 PM
This fix is in the SP1 Beta.

Hassan,
If the Beta doesn't fix your issue it could be a separate bug. Could you provide us with more details? Are you getting the same stack trace? Do you have a simple repro?
Posted by Hassan Gulzar on 1/12/2011 at 3:53 AM
I facing this issue when using Telerik controls. Simple controls work perfectly like Panels and buttons. But heavy controls like the Grid or Ribbon Bar fails. I have a project that exhibits this behavior (Telerik + C# + VS2008 SP1). I also tried on VS2010 SP1 Beta and still no-op.
Posted by amselem on 12/11/2010 at 8:21 AM
Is this fix included in Vs 2010 SP1 Beta?
Posted by Darwin_dcs on 9/29/2010 at 10:39 PM
I tried to dig down and see the consistency of this problem. I found out that this is not occurring if the base project is in C#. Whether the inheriting project is in VB or C#, this will not occur. The problem is when the base project is in VB.

Hopefully that piece of information can help solve this as soon as possible.
Posted by cswsteve on 9/18/2010 at 11:33 AM
I have also run into this problem and it is greatly affecting a project we are working on. Can you please create a hotfix for this?
Posted by Mike1D on 8/19/2010 at 6:25 PM
I can confirm this also.

This was raised in April, where is the hotfix for this issue??
Posted by bdejong_cree on 7/16/2010 at 5:39 AM
Is there anyway that we can get some sort of timeframe for this fix? I read the previous post from Microsoft:

"This fix will be in the next version of Visual Studio, and potentially in 2010 SP1. "

And I am concerned about the phrase "potentially in 2010 SP1". What does this mean? Does this mean that we may not see this fixed in any version of VS2010? this cannot be. We have invested quite some time in VS2010 and upgrading to TFS2010. This was the flagship of all Visual Studios and has caused us some issues especially with this bug and a few others.

Please, please give us some kind of time frame. It is very difficult for me and I would imagine other to discuss with managers taht this is fixed but there is no timeframe for releasing the fix. Throw us eary adopters and supporters a bone....
Posted by MikeGCompass on 7/14/2010 at 5:56 AM
Just an update since previous post, I've found that we had less protected modifers that I'd previously thought.
I was able to search through the code base for "WithEvents Protected" and "WithEvents Protected Friend" to find any controls that would cause an issue.
So although this is still an issue. For the time being, in our company at least, this is less urgent (we can wait till SP1)
Posted by MikeGCompass on 7/13/2010 at 8:13 AM
I agreee this needs to be fixed ASAP with some kind of hotfix. (Unless SP1 is due out very very soon!)
This effectively renders VS 2010 useless as far as we are concerned.
We cannot currently use it on any of our projects which is a real shame.
Posted by bdejong_cree on 6/30/2010 at 4:53 AM
I am going to have to agree that this bug can not wait for the SP since no one here knows when that will be released. This has stopped development in VS2010 for a whole group and now we are in a mixed development mode once again due to being told that a fix is available but we will release it later. Later is not good enough for us at this time. I have management breathing down my back over this one.

Is there a reason it can not be released to us at this time, or how about a date for SP1? I have already told them we have to wait for other bugs and now another one is going to be discussed at the meeting. I am starting to look like a fool for advocating the use of VS2010. Please help me on this one.
Posted by Karl Costenbader on 6/29/2010 at 6:09 PM
Is there any way that this can be released as a hotfix? We are currently unable to deploy VS2010 due to this issue and we have very pressing development projects that must be implemented in .Net 4 as soon as possible.
Posted by Microsoft on 6/29/2010 at 9:58 AM
This fix will be in the next version of Visual Studio, and potentially in 2010 SP1.
Posted by Microsoft on 6/29/2010 at 9:18 AM
We have a fix for this problem and are working on it for the next release.
Posted by Alessandro Giorgetti on 6/23/2010 at 8:11 AM
Same issue here too, we have a lot of inherited forms and changing all the controls from protected to public isn't a very elegant option...

I think this bug will prevent us from keep continue using VS2010 on some projects and switch back to VS 2008
Posted by InterWAS on 6/16/2010 at 2:57 PM
Same issue here, visual inheritance using Protected modifier is broke in VS2010, in VS2008 it works, but now in VS2010 only works using Public modifier.
Another point is it apears to only work, using Protected, in same assembly, if you have to separated .dll the Winforms Designer dont work but in same dll/exe it work.
Posted by Microsoft on 4/19/2010 at 11:12 PM
Thank you for attaching the project and video to help us reproduce this issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Karl Costenbader on 4/19/2010 at 11:03 AM
I have added the sample application that I used to reproduce this issue along with a video captured in SWF format that shows the steps for reproducing. Please let me know if you need additional clarification or information.
Posted by Microsoft on 4/19/2010 at 12:44 AM
Thank you for reporting this issue.
But We are unable to reproduce the issue with the steps you provided.

It may help if you provide us with:
1.    A video file about the issue
2.    A demo project to reproduce the issue

It would be greatly appreciated if you could provide us with that information as quickly as possible.
Thanks again for your efforts and we look forward to hearing from you.
Posted by xal1983 on 4/17/2010 at 2:44 PM
Actually there's one that's slightly different. I believe it is because I have a second binding source that uses the first one as it's datasource.

This is the line that the designer generated originally, and then the stack trace:

        Me.InvoicesBindingSource.DataSource = Me.DataSource

(DataSource is my inherited bindingsource)

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.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)



The other errors are raised at lines such as this:
Me.ClientRefComboBox.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.DataSource, "ClientRef", True))
Posted by xal1983 on 4/17/2010 at 2:40 PM
I'm having the same issue. It seems like the designer is not liking interactions with the inherited controls. In my case, I have a binding source in the base form. If I remove all the databindings (to the inherited binding source) in my derived form and the calls to EndInit from the designer generated code, the designer loads. I get warnings for each of those lines that say "The method or operation is not implemented". In total, counting my databindings and the call to EndInit, it's 7 lines, which match the 7 warnings and the 7 errors the designer shows instead of the actual designer.
The stack trace is the same for all of them:

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)

Sign in to post a workaround.
Posted by Sprint on 10/21/2010 at 6:16 AM
Had this same issue and ironicaly while pmartin62 chaned his from from Friend to Public to fix it I had to do the opposite (change from Public to Friend). Once I did this the form correctly opened. I then went BACK from Friend to Public and it's back to working.
Posted by Pascal Martin on 6/3/2010 at 11:58 PM
In my case I was able to repair those forms by changing the modifier from the buggy form class from "Friend" to "Public".
Posted by cstaff16 on 4/19/2010 at 1:15 PM
We had some apps experiencing this same issue and I found a workaround.
In our scenario we had a base control with some 3rd party infragistics controls on them.
In the inherited control, everytime we tried to open the designer, we would get the above error.
The Infragistics controls on the base class were set with a Protected Modifier.
Once we changed it to a Public Modifier on the base class and re-built, the issue went away and the designer now works in the inherited control.
Maybe this will work for others too.
File Name Submitted By Submitted On File Size  
Video to Reproduce.zip 4/19/2010 799 KB
WindowsApplication1.zip 4/19/2010 22 KB
Visual Inheritance.rar 1/12/2011 21 KB