Fun and games with Visual Studio 2010 beta 2

ctodx
05 November 2009

Well, Houston, it seems we have a problem. The majority — if not all — of our WinForms controls will not work in VS2010 beta 2. To be blunt, there seems to be some serious design flaws.

The problem is that VS2010 beta 2 doesn’t generate any code for the ISupportInitialize interface when you drop controls on a form. In particular, it must generate calls to the BeginInit and EndInit methods of that interface inside InitializeComponent().

Here's an example from VS2008:

private void InitializeComponent() {
  this.dataGridView1 = new System.Windows.Forms.DataGridView();
  ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); // <<***
  this.SuspendLayout();

  // other code dealing with dataGridView1

  ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); // <<*** 
  this.ResumeLayout(false); 
  ...
}

But, with VS2010 we get this:

private void InitializeComponent() {
  this.dataGridView1 = new System.Windows.Forms.DataGridView();
  this.SuspendLayout();

  // other code dealing with dataGridView1

  this.ResumeLayout(false);
  ...
}

Note how the two marked statements from the VS2008 example have disappeared with VS2010 beta 2. Also note that you don't have to use a third-party control, like ours, you can just use the standard DataGridView control to see the problem.

In essence, our WinForms controls can’t (and won't) work properly when the calls to BeginInit/EndInit are not generated at design-time by the IDE like this. There is nothing we can do either: this generated code creates the controls on the form and, by the time our run-time code gets hold of the form, it's way too late (if an exception hasn't already been thrown, of course).

This issue has already been reported by others to Microsoft. Here's an example: http://beta.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=499882

So, enjoy your testing of VS2010 beta 2. We'll be seeing you the other side.

26 comment(s)
Denny Upadhyaya
Denny Upadhyaya

The link you provided says "resolved as not reproducible". Just hope they know about it soon. (PDC !)

5 November, 2009
Brendon Muck [DevExpress MVP]
Brendon Muck [DevExpress MVP]

Looks like it's back to QBASIC for me.

5 November, 2009
Michael Proctor [DX-Squad]
Michael Proctor [DX-Squad]

Wow that is pretty critical, I just started watching that bug now, thanks for the heads up, after this sprint this week I was going to have a look at how our project runs in VS2010, based on this, I won't waste the time ;)

I agree with Brendon, back to QBASIC ;)

5 November, 2009
Anonymous
Tom

Thanks, Julian, for posting about this issue. I'm sure this is the problem that I ran into with DXperience + Beta 2. A total showstopper.

Just a reminder to everyone: Microsoft is running a survey regarding VS2010 and .NET 4.0 beta 2 readiness. I would encourage everyone who has tried beta 2 to give some feedback:

mscuillume.smdisp.net/.../Survey.ashx

5 November, 2009
Boris Bosnjak
Boris Bosnjak

Thanks for explaining what was happening.  

I had tried upgrading a current project to VS 2010 to see how it would do and immediately noticed that DevEx control property values were being lost.  

So, I've abandoned playing with VS 2010 except for experiments with some of the cool new features (i.e, just toying with it).  Hopefully some sort of hotfix gets released soon, otherwise it's kind of pointless.

But it begs the question - how in the world did this make it past even the day-to-day developers at Microsoft?  Or is this an indication that noone at Microsoft does WinForm coding anymore?

5 November, 2009
Anonymous
Tom

Julian, You said: "you can just use the standard DataGridView control to see the problem."

I am able to reproduce the changed code generation when just using DataGridView, but not the crash. On the surface it appears to not be a problem for Microsoft's controls. I tried a bunch of controls, and I didn't see any crashes. But as soon as I dropped DXperience controls onto my form, I was able to easily crash the designer.

6 November, 2009
Eric Harmon_1
Eric Harmon_1

I am able to reproduce the part where the lines of code are not emitted into InitializeComponent, but if I create a simple WinForms application with a dataset and a DataGridView, it loads the grid and runs properly without raising an exception.  Is it possible that Microsoft is relying on some other mechanism now?

But I have issues with VS2010 on all my machines where it locks up if I so much as glance at it sideways, even this morning just starting VS and creating a new project hung the compiler.  So all is definitely not well...

6 November, 2009
Eric Harmon_1
Eric Harmon_1

An update to my previous post: After I ran with the DataGridView, I also added a DevEx GridControl (9.2.6) to my sample project.  I can successfully invoke the designer and do things like specify a sort column and turn off grouping, and then I can run and both grids populate correctly.

I'm not sure what I might be missing, but so far, the lack of those two lines in the designer don't seem to be affecting me.

6 November, 2009
sean kearon
sean kearon

Man, that's grim!  Also from the bug report it looks like the MS team are can't reproduce it!?!?!?

6 November, 2009
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

Tom: The issue with *our* controls is that we do quite a bit of work in the BeginInit method, making allocations, hooking up stuff, and the like. If the BeginInit method isn't called for any reason, the control will crash pretty quickly with some weird exception just because it hasn't been properly initialized. Ditto with the EndInit method where we clean stuff up, but that's not likely to cause bizarre exceptions, just leaks.

The standard controls may do nothing in these methods (I really have no idea), but since they all implement ISupportInitialize they have to have at least some implementation of the methods, even if empty.

So, not calling BeginInit/EndInit may have no effect for the standard controls, but it's death to ours.

Cheers, Julian

6 November, 2009
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

Eric: What does the InitializeComponent() code look like? Were the BeginInit/EndInit calls generated?

Cheers, Julian

6 November, 2009
Mike DePouw SIF
Mike DePouw SIF

I just read the MSFT connect issue and it doesn't look like MSFT can repro.

Julian,

Maybe you should comment on the thread so MSFT can repro.

6 November, 2009
Aaron Smith
Aaron Smith

crap. That's all sorts of not good.

6 November, 2009
Aaron Smith
Aaron Smith

I get the same results as Eric... Mine is working fine as well.

6 November, 2009
Aaron Smith
Aaron Smith

Eric - Open that sample project back up and resize your dev express grid control. Look at the .designer file. Is the BeginInit still there? Mine disappeared after it was there the first time.

6 November, 2009
Aaron Smith
Aaron Smith

Here is how to reproduce the disappearing BeginInit.

www.screencast.com/.../9b52df3b-d6dd-4529-b2e1-b542d6185e2a

6 November, 2009
Eric Harmon_1
Eric Harmon_1

Julian and Aaron:

I didn't convert a project from VS2008.  I created a new WinForms project in VS2010.  BeginInit and EndInit were not emitted at all to InitializeComponent.  However, both the DataGridView and also the DevExpress grid *seemed* to work fine.

I didn't inspect for memory leaks, so there probably were some.  And I didn't do a lot of stuff in the designer - I just sorted on a column and turned off grouping to see if the designer window was working.  So maybe if I try more things it'll crash.

6 November, 2009
Stanislav Honek
Stanislav Honek

Bug report status on Connect changed to fixed.

9 November, 2009
Anonymous
Tom

Well, this situation kind of sucks. Beta 2 just released two weeks ago and has this codegen bug that basically breaks DXperience controls in a big way. Microsoft has apparently now fixed the issue, but most of us won't see any bits for this fix probably until next spring.

9 November, 2009
Bassam Abdelaal
Bassam Abdelaal

that's bad because i can't fully test Beta2 as i wanted , many compile errors with XtraGrid , and i don't have the time to learn MS Grid controls details to test something complex like Entity Framework 4 so i can't test VS2010 for now , so bad , its just 4 months before official launch at Mar 22 , something must be done , I think DevExpress can call their team manager directly for a fix ASAP!

11 November, 2009
Roberto Emma
Roberto Emma

I agree with Abdelaal: this issue is a total showstopper for anybody willing to move in advance in order to design by now his own migration processes for any VS2008/DevExpress towards VS2010.

Let's hope for the best...

12 November, 2009
Burnie35
Burnie35

I just installed VS 2010 Beta with the hope of getting a head start on my rewrite of a POS system. When I installed it all the Toolbox controls showed up, but none of the DevEx components such as the XtraForm. So I tried a repair to no avail, then came to this thread and found out why. Sacre bleu!

Back to VS2008

15 November, 2009
Adriano Trevisan
Adriano Trevisan

Dear Julian and all DevExpress users, I am opening an hotfix request for the current VS 2010 BETA 2 in order to make the Begin/End init fixed before RTM.

Since I know this is problem experienced by a lot of us trying to start developing on the new platform, in this case using DevExpress controls, I ask you if you can make the same request to MS through the "Go Live" program in order to have it fixed.

The MS Connect reference is:

beta.microsoft.com/.../ViewFeedback.aspx

Hope you all can post the same request to have this hotfix.

Hope it helps

Thank you,

Cheers

19 November, 2009
Gary L Cox Jr [DX-Squad]
Gary L Cox Jr [DX-Squad]

Awesome, they have marked this as Fixed.

19 November, 2009
Adriano Trevisan
Adriano Trevisan

Yes, right, however they told me that in order to have the hotfix avaialble before getting the RTM version they need to have more requests for the same.

So, if you can, please, join the VS 2010  Go-Live program and request the same hotfix.

I am sure that most of you want to have the hotfix since we cannot wait months to have this major issue fixed. It's almost impossible to work with this issue. I can't add the missing lines at each design...

Thank you for helping.

20 November, 2009
Carl Pritchard
Carl Pritchard

mmm - as all of my development work now uses Devexpress and I am still using VS 2005 (and still wowing the boses and users with what I and Devexpress can do) - I don't think I willl even bother to waste time evaluating VS2010, going the Go Live program or anything like that.

Frankly - based on the response they gave Adrianot I would say forget VS2010 until at least 2011.

Typical MS to shoot themselves in the foot by saying at a beta stage that 'there are not enough requests'. The whole point of beta is to take virtually all requests as important as you need to multiple the numbers by 100s or 1000s  -so if it fails for 10 at beta - that could be 20% of their overall market. Responding like this just means you have no market!!!

If they cannot respond to companies like Devexpress (which provide functionality that makes VS capable of developing decent products - then are they really listening to anyone.

Perhaps they need a new chief for VS - they do not seem to know who is important.

9 January, 2010

Please login or register to post comments.