.NET Core Designer
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
To maintain compatibility with the .NET Framework, you can leave your multi-targeting unchanged:
To eliminate dependencies on the .NET Framework and switch to using only the .NET Core designer, you will need to employ multi-targeting exclusively with .NET Core targets:
⚠️ Replace your target framework from "net48
" to "net8.0-windows
"and leave the rest unchanged.
Replace your target framework from "net48
" to "net8.0-windows
", and leave the rest unchanged.
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.
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.
If your projects use local and global embedded images in .resx
files, you will need to update the type attribute in all .resx
files and change all casts from System.Drawing.Bitmap
to Wisej.Base.ResourceImage
.
If you are using System.Drawing.Bitmap
, System.Drawing.Image
, or relying on image names, no changes are necessary.
Refer to the page below for instructions on how to update your projects manually or using the provided tool:
Please be aware that .NET Core is capable of reading all designer files initially 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:
It removes the this
keyword. For example, the line this.button1.Text = "button1"
is simplified to button1.Text = "button1"
.
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.
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.
If you have developed a custom designer, contact us for support on making it compatible with the .NET Core out-of-process designer system.