> For the complete documentation index, see [llms.txt](https://docs.wisej.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/docs/welcome/releases/whats-new-in-4.0.md).

# What's new in 4.0

## Getting Started

Wisej.NET 4 introduces significant improvements driven by two main factors:

* The adoption of a `.NET Core`-only designer
* The replacement of `GDI+` with our managed graphics system

The `.NET Core`-only designer, **in addition to the existing `.NET Framework 4.8` designer** enables projects to use the latest `.NET Core` libraries without maintaining `.NET Framework` compatibility.

Replacing `GDI+` with our managed `System.Drawing` library standardizes font measurements across platforms and removes the need for `libgdiplus` on Linux systems.

{% hint style="warning" %}
It is crucial to ensure that any changes made by the designer can be undone and recovered. This ability is essential because if the designer serialization behaves unexpectedly, there is a risk of losing code.
{% endhint %}

{% hint style="info" %}
Visual Studio 2019 is not supported with the Wisej.NET 4 Designer, regardless of whether you use `.NET Framework 4.8` or `.NET Core`.
{% endhint %}

{% hint style="success" %}
We will extend the [support for Wisej.NET version 3.5](#wisej.net-3.5-support). This includes continuing to offer bug fixes and enhancements to ensure stability and reliability for users who are transitioning to version 4.0.
{% endhint %}

## .NET Core Designer

Rebuilding Wisej.NET designers for the out-of-process .NET Core Designer required substantial changes and may present challenges in upcoming builds. Please be prepared to troubleshoot potential issues as we refine the implementation.

Because Visual Studio uses the .NET Framework, Microsoft divided the designer into two parts: the "client" component running on the .NET Framework within Visual Studio and the "server" component running in a hidden .NET Core process. These components connect through an interprocess communication framework. For details on these Visual Studio changes, visit [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls-design/designer-differences-framework?view=netdesktop-9.0).

For details on the .NET Core designer in Wisej.NET 4, visit:

{% content-ref url="/pages/1cNLqYkK3W1JABELUWxA" %}
[.NET Core Designer](/docs/welcome/releases/whats-new-in-4.0/.net-core-designer.md)
{% endcontent-ref %}

## Managed Graphics

`System.Drawing` in .NET Framework and `System.Drawing.Common` In .NET Core wrap Windows GDI+, the graphics device interface is used to render graphics and load fonts on Windows. `System.Drawing.Common` extends to Linux using [libgdiplus](https://www.mono-project.com/docs/gui/libgdiplus/). Microsoft provides no graphic support in .NET Core for iOS or Android platforms.

In Wisej.NET 3.5, font loading used different libraries per platform. .NET Framework `4.8` used `System.Drawing` with Windows GDI+. .NET Core used `System.Drawing.Common` with [libgdiplus](https://www.mono-project.com/docs/gui/libgdiplus/) on Linux. Wisej.NET Hybrid applications used an early `System.Drawing` reimplementation using [ImageSharp](https://sixlabors.com/products/imagesharp/) for iOS and Android. This caused font measurement differences across platforms.

{% hint style="info" %}
Wisej.NET uses two `System.Drawing` classes: `Font` for measuring labels in AutoSize controls and `Image` for loading and managing image resources.

While Wisej.NET doesn't use drawing operations directly, it supports applications that need painting capabilities.
{% endhint %}

Read below to understand how these changes affect your projects and potential issues to avoid:

{% content-ref url="/pages/nBkczB1C9moIHsITFkUZ" %}
[Managed Graphics](/docs/welcome/releases/whats-new-in-4.0/managed-graphics.md)
{% endcontent-ref %}

## Fluent Markup

Microsoft introduced Fluent Markup extensions for .NET Multi-platform App UI ([MAUI](https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui)), which are documented at [Fluent Markup Extensions](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup). These extensions streamline declarative UI development in code.

Wisej.NET 4 incorporated comprehensive support for Fluent Markup syntax in both C# and VB.NET, enabling consistent coding across programming languages.

{% hint style="success" %}
This enhancement came from Tim at [POET](https://wisej.com/case-studies/poetep/), one of our Technology Partners.
{% endhint %}

For an introduction to `Wisej.Web.Markup` extensions, visit:

{% content-ref url="/pages/N62fIlMgNvjFnqENKzN2" %}
[Fluent Markup](/docs/welcome/releases/whats-new-in-4.0/fluent-markup.md)
{% endcontent-ref %}

## Markdown Support

Wisej.NET controls with labels include the [AllowHtml](https://docs.wisej.com/docs/controls/content/label#allowhtml) property for HTML tags in text.

We've added the `AllowMarkdown` property to complement `AllowHtml`. This property enables markdown text rendering across Wisej.NET controls - expanded text formatting options.

{% content-ref url="/pages/iek5uXy3UzWoGwqx9AGN" %}
[Markdown Support](/docs/welcome/releases/whats-new-in-4.0/markdown-support.md)
{% endcontent-ref %}

## Enhancements and Changes

### Service Provider

[Application.Services](https://docs.wisej.com/api/wisej.services/general/wisej.services.serviceprovider) methods are now chainable, allowing concise syntax like `Application.Services.AddService<Service1>().AddService<Service2>()`.

The new `AddOrReplaceService` method replaces a service without requiring prior removal.

### HttpOnly Cookies

We now fully support `HttpOnly` cookies. Previously, developers could use [HttpOnly](https://docs.wisej.com/docs/concepts/security#httponly-cookies) cookies through the native [HttpContext](https://docs.wisej.com/docs/concepts/security#httponly-cookies). The `Wisej.Base.Cookie` class now includes a property for managing `HttpOnly` cookies.

### ControlRendered and ControlUpdated Events

All controls now include the `ControlRendered` and `ControlUpdated` events. This allows applications to modify control JSON rendering and handle browser updates without subclassing.

These events enable [Wisej.AI](https://wisej.ai/) to add AI capabilities to any Wisej.NET control.

### Updated Templates

All C# templates have been revised to incorporate the latest C# syntax enhancements, specifically utilizing [file-scoped namespaces](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/namespace#using-statements-in-file-scoped-namespaces) and [top-level statements](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/top-level-statements).

The updated file-scoped namespace declaration is now implemented across all `.cs` files. However, the transition to top-level statements is applied exclusively to the `Startup.cs` file. This modern approach simplifies the code structure, making it cleaner and easier to read.

## Upgrade from 3.x

Some Wisej.NET projects need changes in `.resx` (resource) and `.Designer.cs` (designer) files for Wisej.NET 4 and managed `System.Drawing` compatibility.

To facilitate this transition, we have provided an upgrade tool that automatically implements these changes across your project files.

For detailed instructions, visit:

{% content-ref url="/pages/C0qeFOP95qZ41ujkBPb7" %}
[Upgrade from 3.x](/docs/welcome/releases/whats-new-in-4.0/upgrade-from-3.x.md)
{% endcontent-ref %}

## .NET Framework and VB.NET Support

Wisej.NET continues to support .NET Framework `4.8` (and newer) and VB.NET at both runtime and design time. As with all preceding versions, we will maintain this support for the foreseeable future.

## Wisej.NET 3.5 Support

To facilitate a smooth transition from Wisej.NET version 3.5 to version 4.0, we will continue to maintain the 3.5 branch by providing bug fixes and enhancements for at least one year following the initial stable release of version 4.0. This ensures ongoing support and stability for existing users during their upgrade process.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/docs/welcome/releases/whats-new-in-4.0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
