WinForms: .NET 5 Design Time Enhancements

ctodx
01 July 2021

Before I describe our new WinForms .NET 5 designer and associated design-time experience, I think a word or two is needed about how we got here and why it took so long to address the needs of our loyal (and patient) WinForms developer community.

WinForms & .NET 5 – a Short Story

With the introduction of .NET Core 3, Microsoft chose to fundamentally alter Visual Studio’s design-time experience – from both a functional perspective and from a third-party implementation perspective. The biggest change to the design-time – and the only option for WinForms moving forward – involved the use of multi-platform code (.NET Core and standard .NET Framework) delivered as a NuGet package.

Microsoft opted to split the design-time into two distinct processes and to execute these processes via different development frameworks. The actual UI (controls and designer preview) now runs within the .Net Core process. Designer UI code or the code that allow components such as ours to be designed inside Visual Studio now runs under .NET Framework 4.6 (4.8). These processes require special message protocols for communication. Furthermore, interface elements used to edit component properties (along with component wizards) must run on the standard .NET Framework. And yes, designer code cannot reference or use actual control types – it can only access control properties using names via specialized proxies.

As you can probably guess, Microsoft’s decision essentially left us with three options:

  1. Sit tight and hope that Microsoft reverses course and addresses our needs. This did not happen.
  2. Rewrite the entire DevExpress design-time experience with standard controls and throw-away a decade or more of work. We were unwilling to compromise and completely unwilling to go this route.

Before we describe the third choice, a quick word about option #2. Setting aside the cost and time involved with this option, had we chosen this route, our unique WinForms design-time experience would have disappeared for good. For instance, all preview-related features within primary designers (such as our WinForms Grid Designer and our Charts Designer) would have never made it to .NET Core 3.

  1. Move our Designer UI into the .NET Core process.

Though option #3 introduced its own set of challenges (inter-process communications, etc), we chose it because it allowed us to share much of the same code base between the two major .NET frameworks. Additionally, this option gave us the ability to maintain design-time continuity between frameworks.

While we had hoped to release a major update late last year, breaking changes prevented us from doing so. The good news is that Microsoft completed its last major change (moving certain designer operations from the .NET Framework to .NET Core) in May with Visual Studio 2019 Build 16.10. Once Microsoft had officially released v16.10, we were in position to complete our redesign and deliver a relatively stable version of our .NET 5 WinForms designer.

DevExpress WinForms .NET 5 Design-Time – A Primer

[Note: To use our .NET 5 designer, you will need to install Visual Studio Build 16.10 or later alongside the .NET 5 Runtime. Of course, you will also need an active DevExpress product subscription (WinForms, DXperience, or Universal).]

Our most recent distribution (v21.1.4) includes a new DevExpress.Win.Design package. As you might surmise from the name, this package powers our Visual Studio .NET 5 design-time experience.

DevExpress.Win.Design will be installed automatically when you generate a new project using our WinForms Template Gallery. If you wish to update an existing app or create a blank project, you can install this package manually. To install manually, navigate to Visual Studio’s “Manage NuGet packages” dialog, select the DevExpress Local package feed, and install DevExpress.Win.Design from the "Browse" tab.

Installing DevExpress.Win.Design package via NuGet

This new package resolves numerous .NET 5 design-time issues and introduces new .NET 5 design-time options, including smart tag menu actions. To deliver this specific capability, we created custom smart tags for key UI elements (Grid columns, Ribbon Bar Items, etc.).

Custom dotNet5 Smart Tag
New Custom .NET 5 Smart Tag


dotNet5 App Template Gallery
.NET 5 Application Template Gallery


dotNET5 Data Grid Designer
.NET 5 Data Grid Designer

Limitations (unfortunately, there are some)

First, this package is only compatible with .NET 5 and does not offer design-time support for the older .NET Core 3.1 iteration.

Second, and perhaps most important, the design-time tools that rely upon Microsoft’s data source binding engine remain non-functional. This limitation cannot be sugar-coated. Without data source binding, you will not be able to create a new fully functional WinForms apps with our .NET Core designer. Yes, you will be able to construct your forms and customize UI controls as needs dictate, but you will not be able to create or assign a data source to your data-driven UI controls. This also means that you cannot auto-generate a user interface based on data (auto-generate columns, etc). To do this, you will still need to use .NET Framework 4.8.

Though we have tried our best to address this limitation, we have yet to find a reasonable workaround. We will continue to explore options in this regard and if we are able to address this matter independently from Microsoft, we will certainly share that information with all of you.

Note: This limitation does not apply to UI controls already bound to data (bound controls can be designed within the IDE).

Third, design-time docking is not yet functional: we have yet to rewrite the “docking-related” design-time code for .NET Core. Once we do, .NET Core design-time docking functionality will mirror its standard counterpart.

Getting Started

We have migrated all of our demos to .NET 5. You can now open any demo within Visual Studio (remember: v16.10 or later) and explore the capabilities of our .NET 5 design time.

The Future

As you can imagine, our new .NET Core Designer remains a work in progress. We cannot address all outstanding issues overnight – and some, like data-binding, may be impossible to work around – but we are working hard to address those matters that are under our direct control.

Your Feedback Matters

As always, we welcome your feedback and look forward to your suggestions. If you encounter an issue with our new .NET Core design-time experience, please submit a support ticket via the DevExpress Support Center. We will be more than happy to follow-up.

FREE DevExpress Xamarin UI Controls

Deliver high-impact native mobile apps with our feature-rich Data Grid, Scheduler, Chart, TabView, Editors, and utility controls. Reserve your free copy today!
Martin Hart
Martin Hart

The effort invested by DevExpress is much appreciated.

A rough path for sure, converting all your designers to NET 5, but I'm sure your users will appreciate the work that is going into resolving this crisis!

Regards,

Martin.

30 June 2021
Paul Fuller
Paul Fuller

I've been holding off from using .NET 5 because frankly writing an application with a UI without using DX controls just isn't something that I want to do.  Now it is time to crack it open and see how it goes.  Expecting some rough spots so nothing mission critical yet!

Are there any known issues running v20.2.4 and v21.1.4 side by side on the same machine and install of VS2019?

Thank you for the obviously major effort by the developers and also for the ongoing good communication on the issues and progress.

Regards,

Paul.

1 July 2021
Customer109543
UR-IT

To be honest - it seems like an miracle that winforms is still alive!! Over the last decade we all went on several occasions to the winforms funeral. :)

The good news: the coffin is still empty! :)


Thx for your hard (impressive) work!

1 July 2021
Customer91195
Customer91195

Bindings good working in designer when:

100% resolved!

1 July 2021
Viatcheslav Vassiliev
Viatcheslav Vassiliev

Would .Net 6 and Visual Studio 2022 make things better? Roadmap (https://docs.microsoft.com/en-US/visualstudio/productinfo/vs-roadmap) says "Finally, we are working on a full designer experience for Windows Forms with .NET 5".

If Visual Studio 2022 and .Net 6 will have normal support for WinForms designer - would it be better to implement designers there and leave Visual Studio 2019 with what is possible to do? I.e. I would vote for complete and reliable (as possible) designer in VS 2022 with weak designer in VS 2019 over designer with compromises that works in both VS 2022 and VS 2019. Of course, there is no guarantee that Microsoft will implement reliable "full designer experience for Windows Forms" in VS 2022, and even if MS will, that their new designer will be compatible with current source code.


Sincerely yours,

Viatcheslav V. Vassiliev

1 July 2021
dbSoft
dbSoft

Thank you Devexpress for keeping us informed!! I have confused about what is going on to happen in near feature.

1. We are made a project using Netframework  4.8. Will this framework be deprecated in near feature? 

2. Is it suggested from Devexpess to migrate all our projects to the new Microsoft's framework NET CORE 5 or 6?

3. Is it better to wait more time after things will be more clear about the route we need to follow?


1 July 2021
Benjamin Hofmann
Benjamin Hofmann

Great job!

I‘m sure we will skip .NET 5 but try to go straight to 6 instead. 

1 July 2021
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

Thanks all for the words of encouragement. It has not been a simple task, by any means, So far what you see is roughly a year's worth of work with still more to come.

Cheers, Julian

1 July 2021
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

@Viatcheslav: OK, that comment on the Microsoft Roadmap made the team and I laugh somewhat, especially as there is absolutely no other detail whatsoever anywhere on Microsoft's site. You see, we've been working as close as we could with the MS team that is responsible for producing the .NET 5 WinForms designer in VS2019 for nearly a year and we've been trying hard to push them to maintain the functionality of the .NET Framework version we've all come to know and love. And despite all that effort, you can imagine how that all went down since we had to write our own designer for .NET 5. So are they going to toss it and write it all again? I would doubt it. Perhaps it's referring to the data source binding functionality? Who knows. I've emailed the team lead to see what it might mean, but to be honest I'm not holding my breath.

Cheers, Julian

1 July 2021
GarryH
GarryH

Can DevExpress please confirm what needs to be done to use .NET 5 and 21.1.4 in an existing VS project?

I have upgraded a Winforms project to .NET 5 and changed dependencies to .NET 5 DevExpress controls but the Visual Studio 16.10.2 GUI designer still does not always display some DevExpress controls. Is this a known issue?

THX

1 July 2021
GarryH
GarryH
I should add that my converted Winforms to .NET 5 DevExpress 21.1.4 Net 5 project (around 30+ forms) runs perfectly in .net 5. I have a few beta users and one reports this new version runs faster the .NET Framework version. Nice!
1 July 2021
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

@GarryH: That's a question best asked via our Support Center. They'll be able to help way faster than me asking them, getting a reply, and then posting it here as a comment 😃

Glad to hear the converted app runs faster under .NET 5!

Cheers, Julian

1 July 2021
Stephen J White
Stephen J White

Greetings Julian,

I am always amazed at how DX strives to keep support going for WinForms, but at the end of the day, it makes sense since there really hasn't been a true successor to WinForms IMO (WPF is a different paradigm to me, even though I love it, it isn't the same). 

I had a suspicion that your team was going to have to start working on their own designer. It seems that with MS being slow to deal with designer needs in VS, others are having to take a crack at it or make separate applications for supplying designer experiences.

I also have a question - will the data binding problem also limit the ability to use the DevExpress MVVM framework with the new designer?


1 July 2021
CRM-f1781b5f-b037-460d-845e-04b1eabd3cd7
Customer210585
nice
1 July 2021
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

@Viatcheslav: From the WinForms Designer team at MS: "very poor wording", "we’re continuing with the same line of work in the designer and on the designer SDK". So, no, all our efforts in creating a new designer will not be for naught.

Cheers, Julian

2 July 2021
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

@Stephen: let me ask the team. I'll be back.

Cheers, Julian

2 July 2021
Viatcheslav Vassiliev
Viatcheslav Vassiliev
Thank you for checking designer support with MS. I had a hope that MS will make .Net Core designer native one in VS 2022 and may be deprecate .Net framework as they deprecated Silverlight in VS 2017. This way they could rewrite native designer from .Net Framework to .Net Core, this could be easier than what MS does now.

Thank you for your efforts with improving work with WinForms, for work on new designer for .Net Core and implementing new ways for forms/controls design such as HTML & CSS templates (https://community.devexpress.com/blogs/winforms/archive/2021/02/24/devexpress-winforms-2021-roadmap.aspx).

Sincerely yours,
Viatcheslav V. Vassiliev
 
5 July 2021
Daz
DAZ
This has been an appalling developer experience (directed at Microsoft not devexpress). Visual studio feels like it is held together with sticky tape these days. It makes me sad.
5 July 2021
DÖNÜŞ ŞENEL
DÖNÜŞ ŞENEL
We know very well that you are doing your best. Thanks for everything. 

Of course, over time (after a short while) everything will settle down.

5 July 2021
Customer69806
Mikael 69806
Good work and a good distance on the road. :) Patiently waiting for the CTP stamp to be removed from your winform controls.
6 July 2021
Eduardo Quintana
Eduardo Quintana

Hi Julian,

DX has always been the premier Windows component supplier. I've been working with your products since 2000.

I am absolutely sure that you will be able to provide a fully functional version of your controls for WinForms.

There is hope that MS will actually redesign Visual Studio in its 2022 incarnation fully WinForms compatible and that .Net 6 will actually be able to natively support WinFoms.

WinForms has no viable replacement so far, at least for me.

DX's dedication to keeping their products compatible with WinForms makes me an even bigger fan of this great company.

Kudos!

Eduardo Quintana



6 July 2021
Brien King
Brien King

Thanks for the work you are doing!

Visual Studio 16.10.x has been the WORST version of Visual Studio in a long time (they broke so many things!).  Seems every version they put out is going backwards.


7 July 2021
Thomas Hogrebe
Thomas Hogrebe
sorry, wrote the comment on the last post, but it fits better here.

Great work so far.

Unfortunately I can't find the good old XtraUserControl again, is that still on your list or have I not found the trick to activate it?
The template gallery only shows a report form and it can't be activated via "inherit" either.

I have been working with the tools for so long, keep up the good work.
 
9 July 2021
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

@Thomas: I would nip over to the Support Center and ask there. You'll get a much faster (and accurate!) response that way.

Cheers, Julian

9 July 2021
heinzler
heinzler

Thx for the update.

I tried to run the new designer on top of our huge application (with 21.1.4 controls and .net5). Unfortunately VS only shows the dialog "Opening the file" and no UI opens.

Its a very sad story so far, and the lack of communication and transparency from microsoft is also not very good in this regard. One can only hope that the situation improves soon.

12 July 2021
heinzler
heinzler
After a 2nd try i could open our form. The experience is horrible so far. Slow and laggy. Drag&Drop of components within a LayoutControl does not work. Furthermore, our IExtenderProvider properties are not visible in the property grid. 
12 July 2021
Dmitry (DevExpress)
Dmitry (DevExpress)

@heinzler yes, this whole situation is far from being ideal. Thank you for staying with us through these harsh times.

We already got a few more reports about LayoutControl problems similar to what you're experiencing: T1011832. You can download a hotfix from this ticket, it should be able to resolve the issues.

13 July 2021
CRM-65a82964-1f81-41f0-95cd-428583eca1f6
Customer212614

I dont understand the main vision. Microsoft is introducing yet another UI? again? and it will be abandoned on next iteration I guess?

Windows 11 is coming this fall, and I guess it will cut the ".NET Framework" (legacy .NET, not the new "CORE").

At that point, WinForm is dead 100% and WPF is dead 100% because companies will have at some point in 2022-2023 upgrade the OS because of end of support.

Considering the state of the work, and things I read (you are laughing, etc...) , I guess we are perfectly set up for a full blown armageddon

15 July 2021
Willie Price 1
Willie Price
If Winforms is practically dead, can someone outline alternatives?  Please!
21 July 2021
Julian Bucknall (DevExpress)
Julian Bucknall (DevExpress)

@Willie: Er, WinForms is anything but dead. Nuff said.

Cheers, Julian

21 July 2021

Please login or register to post comments.