question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Add net6 and net6-windows target

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ziron999o365commented, Sep 18, 2022

This issue is actually pretty big when using sampling code for a Microsoft Graph it requires using Microsoft.Identity.Client.Desktop; which makes .WithWindowsBroker(true) impossible with C# 8/.net 6.

0reactions
bgavrilMScommented, Oct 28, 2022

Can we ship this as part 4.48 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to target .NET 6.0 with Visual Studio 2019?
Under Options, Environment, Preview Features set Use previews of the .NET SDK to true, restart Visual Studio. Restart, in a Visual Studio ...
Read more >
Visual Studio 2019 Not Showing .NET 6 Framework
I've been struggling to change an ASP.NET Core Web API project's target framework to .NET 6 which was started using target framework .NET...
Read more >
Introducing the .NET 6 runtime for AWS Lambda
NET 6, this blog post explains new features added to the .NET Lambda experience. You can use these to improve diagnostics and performance...
Read more >
Create a pull request in Visual Studio with new Git UX
Having to manually do this in the DevOps web UI is a less productive workflow. Visual Studiowindows 10.016.6 preview 4git-ux.
Read more >
Support for the Upcoming .NET SDK 6.0
The latest Rider 2021.3 EAP builds support .NET 6 SDK. Please download them from https://www.jetbrains.com/rider/nextversion/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found