Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pmaytak opened this issue Sep 17, 2022 · 6 comments · Fixed by #3700
Closed

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

pmaytak opened this issue Sep 17, 2022 · 6 comments · Fixed by #3700
Assignees
Milestone

Comments

@pmaytak
Copy link
Contributor

pmaytak commented Sep 17, 2022

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

@pmaytak pmaytak added this to the 4.48.0 milestone Sep 17, 2022
@pmaytak pmaytak self-assigned this Sep 17, 2022
@pmaytak pmaytak moved this from Triage to In Progress in MSAL Customer Trust / QM Sep 17, 2022
@pmaytak pmaytak added the .NET6 label Sep 17, 2022
@ziron999o365
Copy link

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.

@bgavrilMS
Copy link
Member

@ziron999o365 - please use new broker preview experience, which does not require Microsoft.identity.Client.Desktop - see https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/wam

@pmaytak - you already added explicit support for net6. For windows components, users will need to use WAM preview. Closing, please reopen if you disagree.

@bgavrilMS bgavrilMS closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2022
Repository owner moved this from In Progress to Fixed in MSAL Customer Trust / QM Sep 19, 2022
@pmaytak pmaytak reopened this Sep 19, 2022
Repository owner moved this from Fixed to Estimated/Committed in MSAL Customer Trust / QM Sep 19, 2022
@pmaytak pmaytak moved this from Estimated/Committed to In Progress in MSAL Customer Trust / QM Sep 20, 2022
@pmaytak pmaytak moved this from In Progress to Waiting for Code Review in MSAL Customer Trust / QM Sep 23, 2022
@pmaytak pmaytak moved this from Waiting for Code Review to Blocked/Waiting for reply in MSAL Customer Trust / QM Sep 29, 2022
@pmaytak
Copy link
Contributor Author

pmaytak commented Sep 29, 2022

Moving to blocked status until we decide on a proper way to introduce this change, which depends on deprecating old WAM / GAing new WAM.

@kyle-rader
Copy link

.NET 5 has now been fully deprecated and is past end of life support. It's not clear what but my whole team had net5 disappear from over this last week from our dev machines, potentially with the latest VS Update.

There is no straight forward way I can see to possible update to net6.0 without breaking. The table shared above shows one slice where you target net6.0 in your app but use net5.-windows target of MSAL. Is there special CSPROJ magic to override the version the library uses, if building for windows?

@kyle-rader
Copy link

@pmaytak @bgavrilMS Am I doing anything obviously wrong here: AzureAD/microsoft-authentication-cli#154 ?

@bgavrilMS
Copy link
Member

bgavrilMS commented Oct 28, 2022

Can we ship this as part 4.48 ?

@pmaytak pmaytak moved this from Estimated/Committed to In Progress in MSAL Customer Trust / QM Oct 28, 2022
@pmaytak pmaytak moved this from In Progress to Waiting for Code Review in MSAL Customer Trust / QM Oct 28, 2022
Repository owner moved this from Waiting for Code Review to Fixed in MSAL Customer Trust / QM Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants