Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Unanswered
Romacat2 asked this question in Q&A
Discussion options

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!

You must be logged in to vote

Replies: 1 comment

Comment options

Not overly familiar with this, but wanted to suggest using the Visual Studio Publish UI for this process. The documentation for it lists a number of considerations that may be affecting your situation.

https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=vs

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #2455 on May 23, 2025 17:34.

AltStyle によって変換されたページ (->オリジナル) /