-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[regression/8.0.0-rc.1.9171] Vanilla app crashing on Windows in release mode #17368
Comments
Update:
That proved to be fruitless. I wasted hours manually including different NuGet versions of the WinAppSdk, but none of them produced a build that could be started. I can't stress enough how that has only started to happen after I installed the newest maui workload on my build machine and how I seem unable to revert that now :( |
Thanks for reporting this and I think the issue is in the combination of the args and it seems sometimes the dotnet CLI is doing "interesting" things. You have 2 commands, and I will break down why some of them cause issues. However, I believe the main/core issue is that your runtime identifier is The reason this fails is that when you build for Now if you think to use the This leaves your
Next, your build command also needs to be updated to use
This will work, but actually some of the things are no longer needed:
I also have a question about the If you remove the args I mention, then you can build and publish with:
Please let me know if this helps or if you are still seeing crashes. |
Hi @DDHSchmidt. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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. |
Thank you for support, @mattleibow !
The irony of RC1 with the "go live license" to render our build pipeline useless wasn't lost on us... I do hope that changes of that magnitude will stay out of future RCs or at least handled way more carefully :/ But on with the more important news: Your command lines do produce a working, starting app... for the provided reproduction project. Our app includes a project reference to another .Net project, a class library, and that seems to upset the restore command :/ I followed the recommended actions but putting the RuntimeHostConfigurationOption into either or both of the projects had no discernible effect.
To be honest: We've been trying to port our app to MAUI since .Net 6 and most of the parameters (including that one) are probably remnants of our desperate attempts to get a working build somehow. |
After a lot of trial & error (again...) Most obvious changes:
The catch is: This still doesn't work for our real app... Our app uses a private nuget repository for certain, internal artifacts, spread over different feeds.
In summary:
I'm also curious about the "not-regression" tag? Clearly this was all working for us, before the introduction of RC1 and its associated changes. |
Just dropping this for reference, but the WASDK has a bug and does not like the RIDs: https://learn.microsoft.com/en-us/dotnet/maui/windows/deployment/publish-cli We probably need to add this to the template for now, but you need to add this to the csproj: <PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' and '$(RuntimeIdentifierOverride)' != ''">
<RuntimeIdentifier>$(RuntimeIdentifierOverride)</RuntimeIdentifier>
</PropertyGroup> If you use the If you use the RID for iOS, then maybe you can get around the issue by setting that special hidden property, but I have not tested that. And to work around the SDK issue, you need to use With regards to the I am unsure if either of the issues will get fixed for .NET 8, unfortunately. But I think the issue is with passing the RID, you need to trick the SDK into accepting it by using the snippet of code in your app project only. Libraries that have a RID will get yet another WASDK issue: microsoft/WindowsAppSDK#3337 All this is very unfortunate. |
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. |
Sorry for the late reply. Had some health issues and needed to take some unplanned away time.
Was this a typo? Do we have to use x86 or did you mean to write x64 ? As for your other suggestions /p:RuntimeIdentifierOverride & /p:TargetFramework -> They didn't work. I got a working pipeline again by fiddling a ton with the parameters. To my surprise I got it working with
While that appears possible, our internal feeds are behind password protection and I don't see that working without providing the whole nuget.config? |
While this all is very unfortunate, it seems like this is not something that originates in the .NET MAUI SDK. There are linked issues on the WinUI repo which should track work to make this better. Please add comments and details there in order for them to prioritize this correctly. It seems for now that you are in a good place with the pipeline for building your app which I'm happy to see. Closing this here! |
Description
I used to be able to fire up our build pipeline and install/start the *.msix file from
dotnet publish -c Release ...
on Windows.Starting with the latest RC1, the msix files/app generated from that command crashes right on starting.
The output in EventViewer is:
With earlier regressions it was usually enough to revert the <MauiVersion>-Tag in the csproj file to the previous version but that doesn't seem to have any effect here. Setting that back to '8.0.0-preview.7.8842' still resulted in an app from dotnet publish that crashes on startup.
I guess this might have to do with the installed workloads on the build machine, where everything is set to
maui 8.0.0-rc.1.9171/8.0.100-rc.1
??I googled on how to install previous workloads and was greeted with tips like "Use different rollback file" but I have no idea where to point that? So I couldn't test that idea.
I linked a public repository with a vanilla app on RC1 that easily exhibits the problem.
Please tell me that I did something terribly wrong. I just don't want to believe that no one ever tested a release build of the vanilla app on Windows before greenlighting RC1 ...
Steps to Reproduce
dotnet restore CrashTestWin.csproj -p:PublishReadyToRun=false -r win-x64
dotnet publish CrashTestWin.csproj -f net8.0-windows10.0.19041.0 -r win-x64 -c Release --no-restore --self-contained /p:RuntimeIdentifierOverride=win-x64 /p:PublishReadyToRun=false -p:WindowsAppSDKSelfContained=true /p:Platform=x64 /p:GenerateAppxPackageOnBuild=true /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint=<YourCertificateThumbPrintHere>
Link to public reproduction project repository
https://github.com/DDHSchmidt/Maui8RC1CrashWinRelease
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.0-preview.7.8842
Affected platforms
Windows
Affected platform versions
Windows 10 (22H2)
Did you find any workaround?
None yet, but I suspect the WindowsAppSDK to be involved again, since that was the source of numerous problems in the past.
I'm testing inclusion of different WindowsAppSDK versions but since building release mode takes time that is still ongoing
Relevant log output
Depends on
dotnet restore
does not support-f TFM
sdk#35408dotnet publish
results in an error about duplicate files microsoft/WindowsAppSDK#3337<UseRidGraph>
usage #17142The text was updated successfully, but these errors were encountered: