'Dot Net Core - How to Prevent appsettings.production.json from changing upon publish

I'm publishing my .net core website to the server. Here is the code that adds Json files to my content path:

var builder = new ConfigurationBuilder()
                        .SetBasePath(contentRootPath)
                        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                        .AddJsonFile($"appsettings.{environmentName}.json", true);

and here is how the related part of the solution looks:

enter image description here

In my production computer, I have a appsettings.production.json file. I recently had to manualy add MultipleActiveResultSets=true to my connection string.

But everytime I publish the app, that file is reverted to the previous production configuration.

I don't know where the contents of that file is stored and how it remembers its previous state.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source