dotnet publish doesn´t publish correct appsettings.{env.EnvironmentName}.json
Update: For current (new) .csproj format the CopyToPublishDirectory attribute should be used. It determines whether to copy the file to the publish directory and can have one of the following value: Always, PreserveNewest Never So add next section into your .csproj: <ItemGroup> <None Include=”appsettings.Production.json” CopyToPublishDirectory=”Always” /> </ItemGroup> Look into @nover answer and SO Exclude or … Read more