The single-file bundle generation task excluded files that were expected to be included
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
I am building a self-contained single-file application that needs to ship native DLLs next to the binary.
Example csproj: https://github.com/compujuckel/SingleFileNativeDllRepro/blob/master/SingleFileNativeDllRepro/SingleFileNativeDllRepro.csproj
When publishing with the .NET 11 SDK for win-x64, it will emit the following warning:
```
C:\Program Files\dotnet\sdk\11.0.100-rc.1.26425.128\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(1323,5): warning NETSDK1236: The single-file bundle generation task excluded files that were expected to be included: C:\Users\xxx\source\SingleFileNativeDllRepro\SingleFileNativeDllRepro\Redist\steam_api64.dll. This may indicate a mismatch between the SDK's bundle filtering logic and the bundler task.
```
and the .dll file will be missing from the output folder.
However, publishing for linux-x64 includes the .so file as expected.
### Steps to reproduce
Minimal repo to reproduce the issue: https://github.com/compujuckel/SingleFileNativeDllRepro
Using .NET 11 RC1 SDK, publish with
```
dotnet publish -r win-x64 -c Release
```
### Expected behavior
When publishing for win-x64 with .NET 10 SDK, no warning is emitted and the .dll file is included in the output folder:
```
C:\Users\xxx\source\SingleFileNativeDllRepro> dotnet publish -r win-x64 -c Release
Restore complete (0,5s)
SingleFileNativeDllRepro net10.0 win-x64 succeeded (2,2s) → SingleFileNativeDllRepro\bin\Release\net10.0\win-x64\publish\
Build succeeded in 2,9s
```
```
Directory: C:\Users\xxx\source\SingleFileNativeDllRepro\SingleFileNativeDllRepro\bin\Release\net10.0\win-x64\publish
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 15.09.2026 19:56 73484428 SingleFileNativeDllRepro.exe
-a---- 15.09.2026 19:56 11388 SingleFileNativeDllRepro.pdb
-a---- 15.09.2026 19:38 262944 steam_api64.dll
```
### Actual behavior
When publishing with .NET 11 RC SDK a warning is emitted:
```
C:\Users\xxx\source\SingleFileNativeDllRepro> dotnet publish -r win-x64 -c Release
Restore complete (0,0s)
info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
SingleFileNativeDllRepro net11.0 win-x64 succeeded with 1 warning(s) (0,4s) → SingleFileNativeDllRepro\bin\Release\net11.0\win-x64\publish\
C:\Program Files\dotnet\sdk\11.0.100-rc.1.26425.128\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(1323,5): warning NETSDK1236: The single-file bundle generation task excluded files that were expected to be included: C:\Users\xxx\source\SingleFileNativeDllRepro\SingleFileNativeDllRepro\Redist\steam_api64.dll. This may indicate a mismatch between the SDK's bundle filtering logic and the bundler task.
Build succeeded with 1 warning(s) in 0,5s
```
steam_api64.dll will be missing from the output folder:
```
Directory: C:\Users\xxx\source\SingleFileNativeDllRepro\SingleFileNativeDllRepro\bin\Release\net11.0\win-x64\publish
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 15.09.2026 19:53 79261770 SingleFileNativeDllRepro.exe
-a---- 15.09.2026 19:53 12056 SingleFileNativeDllRepro.pdb
```
Comparison, publishing for linux-x64 works as expected:
```
C:\Users\xxx\source\SingleFileNativeDllRepro> dotnet publish -r linux-x64 -c Release
Restore complete (0,0s)
info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
SingleFileNativeDllRepro net11.0 linux-x64 succeeded (0,5s) → SingleFileNativeDllRepro\bin\Release\net11.0\linux-x64\publish\
Build succeeded in 0,6s
```
libsteam_api64.so is present in publish folder:
```
Directory: C:\Users\xxx\source\SingleFileNativeDllRepro\SingleFileNativeDllRepro\bin\Release\net11.0\linux-x64\publish
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 15.09.2026 19:38 398662 libsteam_api.so
-a---- 15.09.2026 19:50 77160818 SingleFileNativeDllRepro
-a---- 15.09.2026 19:50 12056 SingleFileNativeDllRepro.pdb
```
### Is this a regression?
Yes, .NET 9 and 10 SDKs both work
### Are there any workarounds?
_No response_
### dotnet --info output
```console
.NET SDK:
Version: 11.0.100-rc.1.26425.128
Commit: 3551975be0
Workload version: 11.0.100-manifests.a6e318ce
MSBuild version: 18.11.0-1.26425.128+3551975be
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\11.0.100-rc.1.26425.128
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 11.0.0-rc.1.26425.128
Architecture: x64
Commit: 3551975be0
.NET SDKs installed:
6.0.428 [C:\Program Files\dotnet\sdk]
8.0.416 [C:\Program Files\dotnet\sdk]
9.0.308 [C:\Program Files\dotnet\sdk]
10.0.101 [C:\Program Files\dotnet\sdk]
11.0.100-rc.1.26425.128 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 11.0.0-rc.1.26425.128 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 11.0.0-rc.1.26425.128 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 11.0.0-rc.1.26425.128 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
```
### IDE version
_No response_
### Other details
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the minimal SingleFileNativeDllRepro linked in the issue and run `dotnet publish -r win-x64 -c Release` using the .NET 11 RC1 SDK. Inspect Microsoft.NET.Publish.targets around line 1323 and the single-file bundle filtering path mentioned by warning NETSDK1236. Done means the Windows native DLL is retained in the publish output without the warning, while the Linux comparison continues to work.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100