Skip to content

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

@Romacat2

Description

@Romacat2

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions