Skip to main content

.NET Core Designer

Overview​

In Wisej.NET 4, we have reimplemented all designers and editors to be compatible with the new out-of-process Visual Studio designer for .NET Core. We will support both sets of designers and editors for .NET Framework and .NET Core, providing flexibility and functionality for developers in various environments.

The design experience remains unchanged, with one exception: a slight delay at startup occurs because Visual Studio needs to load the hidden DesignToolsServer.exe process. The overall functionality and user experience remain consistent.

How to Use​

To maintain compatibility with the .NET Framework, you can leave your multi-targeting unchanged:

<TargetFrameworks>net48;net8.0</TargetFrameworks>

To eliminate dependencies on the .NET Framework and switch to using only the .NET Core designer, use multiple .NET Core targets:

<TargetFrameworks>net8.0-windows;net8.0</TargetFrameworks>

Change your target framework from "net48" to "net8.0-windows", and leave the rest unchanged.

info

Any reference to net8.0 indicates the version against which Wisej.NET 4 is compiled. In your projects, you can use net9.0 or net10.0.

The net8.0-windows target is required to load the Visual Studio designer because it relies on Windows controls. You won't deploy net8.0-windows itself. Instead, deploy net8.0 on both Windows and Linux platforms.

warning

Any project containing Wisej.NET controls that the designer needs to load must include the net8.0-windows target. Non-visual libraries can target net8.0 alone.

New Startup Wizard​

When you choose one of the updated templates, categorized under Project Type as either Wisej.NET 4 or Wisej.NET 4 Hybrid, you will be presented with the new startup wizard shown below.

The primary change is that you can now independently choose .NET Framework and .NET Core versions. Additionally, under the .NET Framework option, you can select "(None)". The project will be configured with the specific settings relative to each target, either included or excluded, based on your selection.

Image Changes​

Projects with images embedded in .resx files need the resource-manager changes described in the upgrade guide. Early Wisej.NET 4 builds also required Wisej.Base.ResourceImage; that requirement and the class were subsequently removed.

You do not need to replace System.Drawing.Bitmap or System.Drawing.Image with Wisej.Base.ResourceImage. References to images by name remain unchanged.

Refer to the page below for instructions on how to update your projects manually or using the provided tool:

Compatibility​

The .NET Core designer can read designer files created with .NET Framework. However, if the designer code is subsequently updated in .NET Core, it may become incompatible with the .NET Framework designer. Specifically, the .NET Core designer modifies the serialized code in the following ways:

  1. It removes the this keyword. For example, the line this.button1.Text = "button1" is simplified to button1.Text = "button1".
  2. It also eliminates the use of the delegate class when attaching to events. For example, this.button1.Click += new System.EventHandler(this.button1_Click); is simplified to button1.Click += button1_Click;.

The first change, which involves the removal of the this keyword, maintains compatibility between .NET Core and .NET Framework.

However, if you open the designer code that has been updated in .NET Core using the .NET Framework designer, all the event handlers will be lost. This is due to the change in how delegate instances are created and attached to events.

Architecture​

With .NET Framework, everything, including your application, Wisej.NET designers, editors, and serializers, was integrated and run within Visual Studio. With .NET Core, this integration isn't feasible because Visual Studio cannot directly load .NET Core code.

Microsoft divided the designer system into two main components:

  • A "client" component running on .NET Framework within Visual Studio
    • Manages Visual Studio elements like "menus," "toolbars," "property editors," "edit windows," and the "property grid."
  • A "server" component running in a hidden .NET Core process
    • Loads your Wisej.NET code and executes it to render designer windows
    • "Injects" these windows into Visual Studio through the DesignToolsServer.exe process
  • These components communicate through an interprocess framework:
    • The client sends request packets for themes, classes, and application data
    • The server processes these through handlers and returns responses

For details on these Visual Studio changes, visit Microsoft's documentation.

Super-simplified model

Diagnostic Tool​

The Wisej.NET designer toolbar includes a new button positioned to the right of the options and license information buttons. This button opens a small diagnostic window that displays important data, such as the total memory usage and count of objects used by the designer process. By clicking the "Recycle" button within this window, you can close the designer windows and terminate the current designer process. The designer process will automatically restart when you reopen a design view.

Custom Designers​

If you have developed a custom designer, contact us for support on making it compatible with the .NET Core out-of-process designer system.