dotnet / dotnet/sdk

When RuntimeIdentifier is specified on executable application project, compiler shouldn't copy not used native libraries to output directory

Open
#54,075 2 comments 0 reactions 1 assignee Claimed by @baronfel View on GitHub
Area-NetSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
1. Executable application project or test project with ```win-x64```, which references libraries with native dependencies
2. All native dependencies a copied to output dir. Even exotic like linux-musl-loongarch64

### To Reproduce
Small example. Console windows x64 only app with Magick.Net. Magick.Net dependency for Windows x64 is about 23Mb. Compiler copies 230Mb (linux, osx, etc).

Project file
```


Exe
net10.0
enable
enable
win-x64



```
Program.cs
```
var type = typeof(ImageMagick.MagickImage);
Console.WriteLine("{0}", type.FullName);
```

### Further technical details
details of dotnet --info
```
Version: 10.0.102
Commit: 4452502459
Workload version: 10.0.100-manifests.6d969a7e
MSBuild version: 18.0.7+445250245
```
- The IDE is VS 2026

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.