When I issue the following command in the command line:
dotnet publish -o \"./../output\" -c Release
The dotnetcli
publishes the pr
For the new csproj
project format you have to add a new ItemGroup
with the content
PreserveNewest
PreserveNewest
In case you have multiple appsettings.{env}.json
files simply repeat the Content
tag inside the same ItemGroup
and all your settings files will end up in the publish folder.
As mentioned in the comments an even cleaner solution is to use a wildcard include:
PreserveNewest
And all your appsettings
files will be published!