in
Forums
Blogs
DevExpress.com
Client Center
Support Center
DevExpress Channel

This Blog

Syndication

News

ctodx

Discussions, news and rants from the CTO of Developer Express, Julian M Bucknall

Fun and games with Visual Studio 2010 beta 2

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.

Published Nov 05 2009, 04:10 PM by Julian M Bucknall
Filed under: ,
Technorati tags: WinForms, VS2010

Comments

 

Denny Upadhyaya said:

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

November 5, 2009 7:46 PM
 

Brendon Muck [DX Squad] said:

Looks like it's back to QBASIC for me.

November 5, 2009 7:52 PM
 

Michael Proctor [DX-Squad] said:

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 ;)

November 5, 2009 8:00 PM
 

Tom said:

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

November 5, 2009 9:14 PM
 

Boris Bosnjak said:

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?

November 5, 2009 9:33 PM
 

Tom said:

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.

November 6, 2009 12:25 AM
 

Eric Harmon_1 said:

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...

November 6, 2009 6:01 AM
 

Eric Harmon_1 said:

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.

November 6, 2009 6:13 AM
 

sean kearon said:

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

November 6, 2009 9:51 AM
 

Julian M Bucknall said:

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

November 6, 2009 12:00 PM
 

Julian M Bucknall said:

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

Cheers, Julian

November 6, 2009 12:55 PM
 

Mike DePouw_1 said:

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.

November 6, 2009 12:58 PM
 

Aaron Smith said:

crap. That's all sorts of not good.

November 6, 2009 1:01 PM
 

Aaron Smith said:

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

November 6, 2009 1:14 PM
 

Aaron Smith said:

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.

November 6, 2009 1:27 PM
 

Aaron Smith said:

Here is how to reproduce the disappearing BeginInit.

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

November 6, 2009 2:17 PM
 

Eric Harmon_1 said:

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.

November 6, 2009 5:43 PM
 

Stanislav Honek said:

Bug report status on Connect changed to fixed.

November 9, 2009 4:37 AM
 

Tom said:

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.

November 9, 2009 12:35 PM
 

Bassam Abdelaal said:

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!

November 11, 2009 3:57 AM
 

Roberto Emma said:

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...

November 12, 2009 3:31 PM
 

Burnie Willey said:

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

November 15, 2009 6:52 PM
 

adrianot trevisan said:

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

November 19, 2009 3:19 AM
 

Gary L Cox Jr [DX-Squad] said:

Awesome, they have marked this as Fixed.

November 19, 2009 10:25 AM
 

adrianot trevisan said:

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.

November 20, 2009 3:16 AM
 

Carl Pritchard said:

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.

January 9, 2010 1:09 PM

Leave a Comment

(required)  
(optional)
(required)  
Verification code: Required
   
Add

About Julian M Bucknall

Julian is the Chief Technology Officer at Developer Express. You can reach him directly at julianb@devexpress.com. You can also follow him on Twitter with the ID JMBucknall.
Copyright © 1998-2010 Developer Express Inc.
ALL RIGHTS RESERVED