Skip to content

.NET SDK flattens all assets under '\runtimes\win-<ARCH>\native' #49416

@Sergio0694

Description

@Sergio0694

I'm hitting some issues when consuming a NuGet package that contains some assets in the native folder, like so:

Image

My expectation would be that those assets would be copied to the output folder preserving the relative folder structure. This matches the behavior of the classic MSBuild tooling when consuming the package from a legacy UWP project. However, I noticed that when targeting .NET 9, everything gets flattened to the root instead. Looking at the binlog it seems this behavior is a result of the .NET SDK itself? I see this:

Image

It seems like the target paths of all those assets are reset to always just point to the root output folder? For context:

I have a few questions:

  • Is this intended, or is it a bug?
  • Is there a way to restore the previous behavior and preserve the target folder structure?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions