How to get rid of appsettings.json and sni.dll while publishing NativeAot app as a single file

61 Views Asked by At

Publishing NativeAot app as a single file by the following command:
dotnet publish -c Release -r win-x64 is making appsettings.json and sni.dll as a separate dependency.

Basically I want to publish my NativeAot web-api as a single file in dotnet8.0. I want that it should generate only one single-file but it is generating appsettings.json file and sni.dll file along with the exe file.

The Publish options are as follows:

  • Configuration: Release | Any CPU
  • Target Framework: .net8.0
  • Target-Runtime: win-x64
  • NativeAot: true (enabled)

How to generate one single file containing values from appsettings and get rid of sni.dll in the NativeAot web-api application.

0

There are 0 best solutions below