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

Use non-version-specific RID folders in NuGet package #935

Closed
elinor-fung opened this issue Sep 21, 2023 · 2 comments
Closed

Use non-version-specific RID folders in NuGet package #935

elinor-fung opened this issue Sep 21, 2023 · 2 comments

Comments

@elinor-fung
Copy link
Member

The Microsoft.Graphics.Win2D package includes native assets in win10-<arch> directories:

<file target="runtimes\win10-arm64\native\Microsoft.Graphics.Canvas.dll" src="bin\UAPARM64\release\winrt.dll.UAP\Microsoft.Graphics.Canvas.dll" />
<file target="runtimes\win10-x64\native\Microsoft.Graphics.Canvas.dll" src="bin\UAPx64\release\winrt.dll.UAP\Microsoft.Graphics.Canvas.dll" />
<file target="runtimes\win10-x86\native\Microsoft.Graphics.Canvas.dll" src="bin\UAPx86\release\winrt.dll.UAP\Microsoft.Graphics.Canvas.dll" />

Starting with .NET 8, the .NET Runtime will not respect these directories and will only look in non-version-specific directories (win-<arch>). As a result, the assets under win10-<arch> will not be found.

The recommendation is to switch the package to using win-<arch> directories.

The .NET 8 SDK is also using a smaller simplified RID graph by default. When building for a specific RID, a non-version-specific win-<arch> should be used.

Related: microsoft/WindowsAppSDK#3783

@Sergio0694
Copy link
Member

Just to provide an update for this here as well — we merged the fix for this already in the internal repo (Win2D on GitHub is just an upstream mirror of that one), and it will be included in the next feature release (1.1.1), to be released soon 🙂

@Sergio0694
Copy link
Member

A fix for this is now available, in version 1.1.1 of Microsoft.Graphics.Win2D 🙂

getrou pushed a commit that referenced this issue Nov 27, 2023
This PR switches the native libraries to be packed with non-generic RID folders.
Doing so fixes Win2D failing to load (class not registered errors) when using .NET 8.
See #935 for more details.

### Screenshots

![image.png](https://mscodehub.visualstudio.com/8b1f3307-e83a-4982-b590-048338090061/_apis/git/repositories/dc534cf5-25c9-4f57-83b0-7a52fa2a046d/pullRequests/27972/attachments/image.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants