dotnet/Silk.NET

How to properly publish a single .exe using Silk.NET?

Closed this issue · 0 comments

Hi everyone,

I'm working on a C# project using Silk.NET (along with some other libraries like StbImageSharp and System.Text.Json), and I'm trying to produce a single self-contained .exe file using dotnet publish -c Release.

Here’s my .csproj configuration:
**

WinExe
win-x64
net9.0
Voxel_CSharp
true

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>false</ImplicitUsings>
<Nullable>enable</Nullable>

<Optimize>true</Optimize>
<DebugType>none</DebugType>
<Deterministic>true</Deterministic>

<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
** Despite setting PublishSingleFile and SelfContained to true, the resulting output still includes several .dll files next to the executable. My goal is to have a single working .exe without extra files beside it.

Is there something I'm missing or doing incorrectly to make this work with Silk.NET? Any help or guidance would be greatly appreciated.

Thanks!