1

I have a console app with this test.csproj:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> 
</PropertyGroup>

<ItemGroup>
    <PackageReference Include="Serilog" Version="2.11.0-dev-01380" />
    <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
</ItemGroup>

</Project>

When I launch dotnet publish these files are created:

test.dll
test.pdb
test.runtimeconfig.json
Serilog.dll
Serilog.Sinks.Console.dll

How can I produce a single test.dll that contain all others dlls?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • I doubt this works with .net core, but back in the day we had: https://github.com/dotnet/ILMerge – mxmissile Apr 04 '22 at 19:37
  • 3
    You seemed to have missed the all important "PublishSingleFile" and "SelfContained" options https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview – gunr2171 Apr 04 '22 at 19:40

0 Answers0