I need to edit a connection string in my appsettings.json file for debugging a .Net Core MVC application. When I run the application with the IIS Express debugger, my application is built to bin\Debug\netcoreapp2.2
. From within this directory, I'm editing my appsettings.Development.json configuration file with the values I need for testing. I know the application is pulling the right variation of the appsettings.json files. However, I don't think the debugger is looking at the file in bin\Debug\netcoreapp2.2
, since when I edit that file the changes are not present in my application. Where does the IIS Express debugger load the appsettings.json files from?
Screenshots for more context.
I run the debugger from this tool bar.
The debugger builds the files to bin\Debug\netcoreapp2.2
.
I then edit the necessary appsettings.json file. The file is not overwritten in future builds since I have the "Copy To Output Directory" property set to "Copy if Newer"
I verified that the ASPNETCORE_ENVIRONMENT variable is set to "Development" for the Debugger.
But then when I go to debug my app, I get the default connection string in the project's appsettings.json and not the modified connection string in the bin\Debug\netcoreapp2.2
directory's appsettings.json