Skip to content

[Feature Request] Add net6 and net6-windows target #3682

@pmaytak

Description

@pmaytak

Goal: Find a solution for how to add net6 target to allow the use of System.Text.Json and IL trimming.
Problem:

  • Current net6-winX apps reference net5-winX MSAL, which provides old WAM and embedded webview. After adding net6 MSAL target, the same apps end up targeting net6 MSAL, which does not have built in WAM and embedded webview implementations. So this is a breaking change.
  • Current net6 and net6-win apps use netcoreapp2.1 MSAL. netcore2.1 target does not provide WAM or embedded webview out of the box. netcore3.1 apps can reference MSAL.Desktop package to enable those features. However, since MSAL.Desktop references Windows features, net6 apps cannot reference it.

The possible solutions are:

  • Add net6 only target with a requirement to use Msal.Broker for broker, which will be a breaking change for net6-win apps.
  • Add net6 and net6-win targets, with net6-win target using old WAM. However, this will not unblock the apps (Azure Functions team scenario) which target net5-win/net6-win, since these will still depend on Win Forms components. And after old WAM will be deprecated, we'll be stuck with an unneeded net6-win target.

Current target platform compatibility and Windows UI component support (for related and newer platforms):

App targets MSAL target used WAM Embedded Browser
net6 netcore2.1 Error and cannot use MSAL.Desktop Error and cannot use MSAL.Desktop
net6-win netcore2.1 Error and cannot use MSAL.Desktop Error and cannot use MSAL.Desktop
net6-winX net5-winX Old WAM Works
net5 netcore2.1 Error and cannot use MSAL.Desktop Error and cannot use MSAL.Desktop
net5-win netcore2.1 Error and cannot use MSAL.Desktop Error and cannot use MSAL.Desktop
net5-winX net5-winX Old WAM Works
netcore2.1-3.1 netcore2.1 Error; use old WAM via MSAL.Desktop Error; use MSAL.Desktop

Note: System browser is available on all platforms.

Useful tool: Get Nearest Framework
References:
.NET 5 design doc, and specifically compatibility/precedence section
.NET 6 design doc

Also to note, the design doc specifies that net6.0 adds both, NET5_0 and NET6_0 preprocessor flags, but in my testing, net6.0 only adds the NET6_0 flag.

Related: #1550, #3407

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions