dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.71k forks source link

Purple Screen When Using Microsoft.Identity.Client #19737

Open maxtsw opened 8 months ago

maxtsw commented 8 months ago

Description

When Trying To Use Microsoft.Identity.Client I Am Getting A Purple Screen When Using Unpackaged, Release.

This Does Not Happen When Running In Debug Within Visual Studio, Only When Published And Running The .exe From Within The Publish Folder

To Ensure This Is The Library I Created A New .New Maui Blazor Hybrid APP, And Slowly Added The Required Nuget Packages, I Changed Nothing Else

Command: dotnet publish -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true

Platform: Windows

Outcome maui-purple-screen

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

ghost commented 8 months ago

Hi @maxtsw. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

drasticactions commented 8 months ago

Could you please create a repro project showing this? I understand that it's "Add Nuget and deploy" but having a standard base project to work from would make it easier to debug should it work for others.

maxtsw commented 8 months ago

Hi,

I have created this repo https://github.com/maxtsw/ExamplePurpleScreenMauiError

I also noticed I am getting duplicate file Microsoft.Web.WebView2.Core.dll error when publishing that I use <WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType> to mitigate

Kind Regards, Max.

ghost commented 8 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

Eilon commented 8 months ago

Hi,

I have created this repo https://github.com/maxtsw/ExamplePurpleScreenMauiError

I also noticed I am getting duplicate file Microsoft.Web.WebView2.Core.dll error when publishing that I use <WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType> to mitigate

Kind Regards, Max.

Hi, it looks like that repo is not available. Is it perhaps non-public?

BethMassi commented 8 months ago

@Eilon I was able to repro this. Try: https://github.com/BethMassi/MauiApp3-HybridMSAL

Publish command: dotnet publish -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true

Creating an MSIX package and installing that works as expected, looks like it's just a problem with unpackaged.

BethMassi commented 8 months ago

I also just tried this with a native (non-Hybrid) MAUI app and this also repros so I don't think this is specific to Blazor hybrid.

maxtsw commented 8 months ago

Hi, I have created this repo https://github.com/maxtsw/ExamplePurpleScreenMauiError I also noticed I am getting duplicate file Microsoft.Web.WebView2.Core.dll error when publishing that I use <WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType> to mitigate Kind Regards, Max.

Hi, it looks like that repo is not available. Is it perhaps non-public?

Appologies this is now public

GaurangRLB commented 5 months ago

Do you have any updates on this? This is causing an issue with our application. We cannot release a new version of our application until this is resolved. This is even happening without the usage of Microsoft.Identity.Client

42gabs commented 4 months ago

I had the same problem when I try create using inno setup. The only way i have discovery to fix this, was changed the install folder of the aplication out of C:/Program Files (or C:/Program Files x86), something like C:/newFolderMaui, it works for me