Introducing .NET Core Windows Forms Designer Preview 1

Olia Gavrysh

Olia

Introducing .NET Core Windows Forms Designer Preview 1

We just released a GA version of .NET Core 3.0 that includes support for Windows Forms and WPF. And along with that release we’re happy to announce the first preview version of the Windows Forms Designer for .NET Core projects!

For developers the .NET Core Windows Forms Designer (when we will release the GA version) will look and feel the same as the .NET Framework Windows Forms Designer. But for us it is a huge technical challenge to bring the designer to .NET Core because it requires the design surface that hosts the live .NET Core form to run outside the Visual Studio process. That means we need to re-architect the way the designer surface “communicates” with Visual Studio. You can watch these communications in the Output Window, where we track each request sent when the Visual Studio components are accessing properties or executing methods on the live controls in the design surface. The engineering team is still working on this technical challenge, and we will be releasing the Preview versions on regular basis to give you the early glance at the .NET Core Designer. Stay tuned! The next Preview will be coming out in early November.

Because this is the very first preview of the designer, it isn’t yet bundled with Visual Studio and instead is available as a Visual Studio extension (“VSIX”) (download). That means that if you open a Windows Forms project targeting .NET Core in Visual Studio, it won’t have the designer support by default – you need to install the .NET Core Designer first!

Enabling the designer

To enable the designer, download and install the Windows Forms .NET Core Designer VSIX package. You can remove it from Visual Studio at any time. After you install the .NET Core Designer, Visual Studio will automatically pick the right designer (.NET Core or .NET Framework) depending on the target framework of the project you’re working on.

It is early days for the designer, here is what to expect…

Please keep in mind, that this is the first preview, so the experience is limited. We support the most commonly used controls and base operations and will be adding more in each new Preview version. Eventually, we will bring the .NET Core Designer at parity with the Windows Forms Designer for .NET Framework.

Because many controls aren’t yet supported in Preview 1 of the designer, we don’t recommend porting your Windows Forms applications to .NET Core just yet if you need to use the designer on a regular basis. This Preview 1 is good for “Hello World” scenarios of creating new projects with common controls.

Controls included in Preview 1:

  • Pointer
  • Button
  • Checkbox
  • CheckedListBox
  • ComboBox
  • DateTimePicker
  • Label
  • LinkLabel
  • ListBox
  • ListView
  • MaskedTextBox
  • MonthCalendar
  • NumericUpDown
  • PictureBox
  • ProgressBar
  • RadioButton
  • RichTextBox
  • TextBox
  • TreeView

What is not supported in Preview 1:

  • Container
  • Resources
  • Component Tray
  • In-place editing
  • Designer Actions
  • Databinding
  • User Controls/Inherited Controls

Give us your feedback!

We are putting out our first bits so early to support the culture of developing the product with our users’ early feedback in mind. Please do reach out with your suggestions, issues and feature requests via Visual Studio Feedback channel. To do so, click on Send Feedback icon in Visual Studio top right corner as it is shown on the picture below.

We appreciate your engagement!

Addressing Questions

What to do if Windows Forms Designer doesn’t work?

We heard some question related to the Windows Forms Designer not working. Here’s what could have happened:

  1. You might have created a .NET Core Windows Forms project instead of the traditional .NET Framework one without realizing it. If you type “WinForms” or “Windows Forms” in the New Project Dialog, the first option would be a .NET Core Windows Forms project. If your intention is to create a .NET Framework project (with the mature designer support), just find and select Windows Forms App (.NET Framework).

  2. If you want to work with .NET Core project, don’t forget to install the .NET Core Windows Forms Designer, since it isn’t yet shipped inside Visual Studio by default. See the previous “Enabling the designer” section.

Does .NET Core WPF Designer depend on Windows Forms Designer installation?

We also received some questions related to the .NET Core WPF Designer not working and if it requires a separate installation or the Windows Forms Designer installation. No, the WPF Designer is completely independent of the Windows Forms Designer. We released its GA version of the WPF .NET Core Designer at the same time as .NET Core 3.0 and it comes with Visual Studio. In Visual Studio version 16.3.0 we had an issue with the Enable XAML Designer property set to false by default. That means that when you click on .xaml files, the designer doesn’t open automatically. Upgrade to the latest Visual Studio version 16.3.1 where this issue is fixed. Another option to fix it is to go to Tools -> Options -> XAML Designer and check Enable XAML Designer.

106 comments

Comments are closed. Login to edit/delete your existing comments

          • John McCourt
            John McCourt

            I started programming SuperBASIC on a Sinclair QL when I was 10 during the early 90s. I’ve lost count of the number of times I’ve had to update my programming skills since then. It usually is annoying having to modernise, but I can’t think of a time when there hasn’t been some good rationale behind it. VB6 to .NET was a big one and .net is huge compared to the old way of doing things. Php 5.x to 7.x was faster, had a lot of security fixes and better object orientation. Now I’m going through the same with C# .Net Framework and .NET Core but I read a bit about why and it makes sense to me.

            Some of the rationale for this update is that .NET Framework is now over 17 years old. It grew and grew while having to keep backwards compatibility. For legacy projects that’s great, but why should a brand spanking new project need to have all the frameworks for backwards compatibility going back 17 years? So MS have made fresh a new framework from the ground up that doesn’t have all that unnecessary stuff and is built on modern, secure framework built for today’s application styles. A new .NET Core deployment only has what it needs to have, not all that archaic stuff from years ago and supposedly it’s not restricted to deployment on Windows which is quite a big deal for people coming from Linux/FreeBSD backgrounds.

            Personally I’m enjoying this. The C# guys at my company have big egos because they have more experience in C# than I do, but only with .NET Framework. I’m now the guy with the most C# Core .NET and MVC Core .NET and can joke that they are using a legacy programming language/framework and all their code is legacy code. They can never be more senior in .NET core than me 😉

      • Avatar
        Craig Johnson

        I got it working no problem with VB.NET. WinForms with the designer preview as well as Console apps work great with .NET Core 3.0. The New Project template for VB WinForms on .NET Core is missing but you can create a Console VB .NET Core app and then replace the .VBProj info from a working .CSProj WinForms .NET Core app and it all works.

  • Avatar
    Sérgio Terenas

    RDLC ReportViewer is a component we’d need to be able to modernize our winforms app. Will you also convert this component to .net core? Thanks Olia for the great presentations and info you’re sharing.

      • Avatar
        Heinrich Moser

        Ah, great, then I will add my feedback regarding RDLC as well!

        The important part would be porting the renderer, i.e., the engine rendering an RDLC file to a PDF or an EMF (for printing), to .net core. (Yes, an XPS renderer for “modern printing” would be nice as well, but that’s another issue.) The actual “ReportViewer” preview UI component is not relevant (at least for us), since previewing an EMF stream in WinForms/WPF or previewing a PDF in HTML are solved problems with widely-available existing solutions.

        I do have high hopes for RDLC (since you acquired the Forerunner library), and I am looking forward to any news/roadmaps/rumors you can share with us.

      • Avatar
        Daniel Smith

        Good to hear it’s under review. The ReportViewer control is critical for many of my desktop apps that produce reports. This is currently the only thing that’s preventing me from upgrading to .NET Core.

        If it turns out to be too big a project to migrate ReportViewer, is there any possibility of open sourcing it, so the community can help?

        Congratulations on getting the designer working as well – really appreciate all the effort that’s going into bringing the full productivity of WinForms into Core 🙂

  • Avatar
    Jimmy Schwietert

    Wouldn’t the inclusion of Windows only features, like Windows Forms and System.DirectoryServices, go against the premise of Core? Core was supposed to be a cross platform language that could be executed on Windows, Linux and Mac.

    • Raul Rodriguez
      Raul Rodriguez

      For me it is about choice. I can create a headless application that runs on Windows, Linux and Mac. I can port my very big existing WinForms application to .NET Core and get all the goodies (performance, enhancements, …) and for me it is ok (and understandable) that it will be Windows-only. I would prefer every day this solution than rewriting my application with a new UI framework to be able of running under Linux or Mac. Our current approach for cross platform is web development.

    • Avatar
      Stephen Donaghy

      The “premise” of core isn’t just about making everything run on every system. It was mainly to decouple the framework from Windows itself, but that doesn’t mean you can’t use things that are specific to a certain platform. It’s about choice and giving you the options to use something platform specific if you want, but without forcing to you.

      If you go down the route of “Well this is a platform specific thing, so we’re not including it” then you’ll lose all kinds of other stuff like platform intrinsics, GPIO for your raspberry pi and so on. You won’t be able to port to IoT devices without gutting the entire platform because you have to only support the lowest common denominator.

    • Olia Gavrysh
      Olia GavryshMicrosoft employee

      Thanks for the great responses above Raul and Stephen! I can only add that WinForms and WPF are available for .NET Core as a separate desktop workload, so if you don’t need them, you won’t receive the desktop SDK and it won’t affect you in any way. But if you are a WinForms or WPF developer, there are many great features that become available with .NET Core like side by side deployment of different .NET Core versions, single .exe files, self-contained applications with smaller sizes, performance, new language features and so on. As Stephen pointed out, .NET Core is not only about being cross-platform, it is the future platform of .NET that will receive all the improvements going forward. We didn’t want to leave our desktop developers behind, so now they’re able to receive all Benefits of .NET Core as well.

  • Eric Rasmussen
    Eric Rasmussen

    Very nice, thank you! I want to experiment with this alongside compiling the entire thing into a single trimmed-down EXE. Being able to ship a single binary that contains all dependencies is one of my favorite features of .NET Core 3. Being able to ship a single-binary WinForms application would definitely make deploying my software a lot easier.

    Sometimes there is nothing better than WinForms for tossing an idea together in an afternoon. I look forward to playing with the early bits, thanks for releasing it!

  • Serhii Gl
    Serhii Gl

    At the main page of blogs it is declared .NET Core. Free, multi platform, open source. Still here we see Windows Forms, Wpf which are for Windows only. We want to write multiplatform UI as well.

    • Olia Gavrysh
      Olia GavryshMicrosoft employee

      We’ve discussed “why bringing WinForms and WPF to the cross-platform .NET Core” earlier and there are good answers for that question. WinForms and WPF will remain Windows-only because of the nature of these technologies but I’ll be curious to talk to you about multi-platform UI. If you’d like to share your scenarios for cross-platform desktop applications, please reach me out at oliag@microsoft.com or twitter: @oliagavrysh, that would be very helpful for us!

  • Avatar
    Andres

    Many thanks to all the team for maintaining Winforms!

    Any plans porting the Visual studio Tools For Office (VSTO) to .Net 5/7?
    We have some Excel VSTO add-ins in C#, some use Task Pane with Winforms controls. It would be great if this kind of development experience would also be possible in the “new .Net”.

    All the best!

  • Marek Chramosil
    Marek Chramosil

    Is there any chance you could make the designer generate (in .Designer.cs) objects and their properties in alphabetical / or at least some deterministic order? It would greatly help with modern source controls – in both the size of commit changes and difficulty of merging. Thank you!

    PS: Same would be useful for .csproj files (even if less so now with the new .csproj format) and Linq2Sql DBML files.