Posts

Showing posts from December, 2018

Update: Single connection string for Multiple Developers

Image
https://dcdevs.blogspot.com/2017/06/single-connection-string-for-multiple.html If you have implemented the trick above, you may have noticed it has stopped working when you moved to a .NET Core project. This is because the DB connection alias is achieved via registry keys which is a Windows-specific behavior. .NET Core supports cross platform development, so Microsoft elected not to implement this Windows-only feature. However, .NET Core provides a new way to manage such configurations across developers - user secrets. In Visual Studio, right click on the project that contains your appsettings.json file and navigate to manage user secrets. User secrets are machine only - Visual Studio will not try to check them in to source control. Here, you can mimic the structure of your appsettings.json to overwrite any configuration setting - not just the connection string! Any values you define here will overwrite the corresponding appsettings.json value (hierarchy must match).