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

[.NET 8 RC1] WinUI 3 App(C# Unpackaged) fails to run. #8801

Closed
AnnYang01 opened this issue Aug 30, 2023 · 13 comments
Closed

[.NET 8 RC1] WinUI 3 App(C# Unpackaged) fails to run. #8801

AnnYang01 opened this issue Aug 30, 2023 · 13 comments
Labels
bug Something isn't working closed-Fixed Described behavior has been fixed. needs-triage Issue needs to be triaged by the area owners team-Markup Issue for the Markup team

Comments

@AnnYang01
Copy link

AnnYang01 commented Aug 30, 2023

Describe the bug

When we create a "Blank App, Packaged (WinUI 3 in Desktop)" with .NET 8 RC1, we met 3 errors about NETSDK1083 (record in microsoft/WindowsAppSDK#3842), we update the <RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers> to <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>, and run it, it fails to run.

Steps to reproduce the bug

1.Install VS from Pipelines - Run main-34029.95 (Contains the .NET 8 RC1)
2.Create a new app using the "Blank App, Packaged (WinUI 3 in Desktop)"
3. In order to avoid NETSDK1083 error, we should update the <RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers> to <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
4. Add this property to the first PropertyGroup of project file: None
5. To debug in Visual Studio, select the 'Unpackaged' launch profile in the Start drop down.
6. Build and run.

Actual result

fail to run
output log
Exception thrown: 'System.DllNotFoundException' in Microsoft.WindowsAppRuntime.Bootstrap.Net.dll
The program '[13388] App8.exe: Program Trace' has exited with code 0 (0x0).
The program '[13388] App8.exe' has exited with code 3762504530 (0xe0434352).
image

Expected behavior

App runs without errors.

Screenshots

No response

NuGet package version

None

Windows version

Windows 11 (22H2): Build 22621

Additional context

VS version: 17.8.0 Preview 2.0 [34029.95.main]
Windows App SDK version: 1.3.230602002

@AnnYang01 AnnYang01 added the bug Something isn't working label Aug 30, 2023
@ghost1372
Copy link
Contributor

There was a breaking change in .NET8 to how it handles the runtime identifier graph: [Breaking change]: Projects targeting .NET 8 and higher will by default use a smaller, portable RID graph. · Issue #36527 · dotnet/docs (github.com). To use .NET8 with Windows App SDK, setting UseRidGraph to true is recommended.

@AnnYang01
Copy link
Author

@ghost1372
I have added a RuntimeHostConfigurationOption MSBuild item in my project file, but it still fails to run. attach my project.
App16.zip
image

@bpulliam bpulliam added the team-Markup Issue for the Markup team label Sep 7, 2023
@AnnYang01
Copy link
Author

@ghost1372 Add<UseRidGraph>true</UseRidGraph>into PropertyGroup tab, WinUI 3 App(C# Unpackaged) can run successfully now, so maybe this issue can be closed.

@dotMorten
Copy link
Contributor

dotMorten commented Sep 18, 2023

I don't think this issue should be closed. WindowsAppSDK needs to deal with these breaking changes correctly.
The workaround is only there for the packages to catch up to this change, and not a permanent solution.

To use .NET8 with Windows App SDK, setting UseRidGraph to true is recommended.

That's not how I read that. The recommendation is to use portable ids.

@KritR
Copy link

KritR commented Sep 28, 2023

@dotMorten If I’m understanding this correctly then, until all my app’s dependencies use portable id’s, my application needs to use the legacy runtime identifier graph?

@dotMorten
Copy link
Contributor

I believe so yes. @richlander can probably confirm

@dotMorten
Copy link
Contributor

dotMorten commented Nov 14, 2023

.NET 8 shipped today. Any news on getting a patch out to update RIDs to correctly support .NET 8?

From release notes:
image

@riverar
Copy link
Contributor

riverar commented Nov 14, 2023

I got my first question about this today too. If a MUX/WAS patch is not the pipeline, perhaps adding an explicit compatibility note to http://aka.ms/netsdk1083 would help? (Link is displayed in build errors.)

@greatoceansoftware
Copy link

greatoceansoftware commented Nov 14, 2023

I am having the same issue. Trying to update my WinUI 3/.NET 6 to .NET 8. While setting the RIDUseGraph to true works, I also found that the following change in the project file also works (so far; I haven't tried to create and distribute MSIX yet):

Modified the following lines in .csproj from:

<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>

To:

<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>

But I still get this warning after building (the project builds and runs successfully):

Found version-specific or distribution-specific runtime identifier(s): win10-arm64, win10-x64, win10-x86. Affected libraries: Microsoft.WindowsAppSDK. In .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage for details.

@llongley llongley added the closed-Fixed Described behavior has been fixed. label Jan 31, 2024
@riverar
Copy link
Contributor

riverar commented Jan 31, 2024

@llongley Can you share the fix details here?

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jan 31, 2024
@greatoceansoftware
Copy link

Yes, @llongley would like to know the details.

@riverar
Copy link
Contributor

riverar commented Feb 17, 2024

@Scottj1s Can you help close the loop here?

@codendone
Copy link
Contributor

The internal task was closed with these comments:

Resolved with NET8 related project templates and NuGet package changes (support for both conditional and non-conditional RIDs)

The project templates will be in a future Visual Studio release. I think some of the NuGet package changes won't be available until the next 1.5 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closed-Fixed Described behavior has been fixed. needs-triage Issue needs to be triaged by the area owners team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests

9 participants