Skip to main content Skip to footer

Visual Studio 2010 beta Compatibility

If you convert an existing project or solution to Visual Studio 2010 beta there should be no problem. But if you are creating new projects within VS2010 beta there are a couple things you need to know when using ComponentOne WinForms controls.

  1. You cannot target .NET 4.0 Client Profile (which is the default for any new WindowsApplication.)
  2. The ISupportInitialize BeginInit and EndInit methods do not get generated automatically when you drop a new C1 control on the form.

Workarounds

1. Targeting .NET 4.0 Framework

To use ComponentOne WinForms controls under .NET 4, you must target the full .NET 4.0 Framework. By default, new projects are set to target the .NET 4.0 Client Profile. ComponentOne controls depend on the full framework to run properly. If your application is targeting the Client Profile, ComponentOne controls will not appear in the toolbox, and you’ll receive errors regarding System.Design.dll.

To change this setting for C# applications: go to the project's properties (from the Visual Studio menu, select Project | Properties...) and from the Application tab change the Target framework to ".NET Framework 4".

To change this setting for VB applications: go to the project's properties (from the Visual Studio menu, select Project | Properties...) and from the Compile tab click the Advanced Compile Options…. From this window change the Target framework to ".NET Framework 4".

Upon changing this you will be prompted to close and reopen the project.

*UPDATE* We will be releasing Client-Profile-Compatible versions of all controls in our 2010 v2 release.

2. Adding New Controls to the Form

When you add a new C1 control onto your form in Visual Studio 2010 beta, everything should appear fine until you go to run the form. The control will be missing. This is because of a bug in Visual Studio where the ISupportInitialize’s BeginInit and EndInit methods are not added automatically.

The fix is real simple. Just open up your designer-generated code and add these missing method calls.

For C# applications, open up .Designer.cs and add the following two lines of code above the form’s SuspendLayout and ResumeLayout methods (replace c1Chart1 with the name of your control).

((System.ComponentModel.ISupportInitialize)(this.c1Chart1)).BeginInit();
this.SuspendLayout();

...

((System.ComponentModel.ISupportInitialize)(this.c1Chart1)).EndInit();
this.ResumeLayout(false);

For VB applications, click the “Show All Files” button from the Solution Explorer and then open .Designer.vb. Add the following two lines of code above the form’s SuspendLayout and ResumeLayout methods (replace C1Chart1 with the name of your control).

CType(Me.C1Chart1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()

...

CType(Me.C1Chart1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

You will need to do this for each C1 control added to your form.

The good news is this bug will be fixed in the official release of VS2010.

Studio for WPF

Regarding ComponentOne WPF controls...if you convert your existing project to VS2010 beta you should have no problem. We have reported errors of adding C1Chart and C1DataGrid to the toolbox and dragging them to a new form. These will be addressed for the official release.

comments powered by Disqus