appsettings.Development.json #53
Replies: 4 comments 4 replies
-
I recommend everyone use (localdb)\mssqllocaldb as the server name, and keep tracking appsettings.json. This server name should be valid in everyone's local environment. This also makes integration testing easier (with one of my libraries for example, but there are others that do this). For example: The "automatic instance" info is what's helpful here. |
Beta Was this translation helpful? Give feedback.
-
Can we not add Also, @adamfoneil raised a good point of having a consistent connection string so that we can use it for integration tests. This might be overkill but we could always look at creating a docker container so that the dev setup is consistent for everyone. |
Beta Was this translation helpful? Give feedback.
-
I have used Docker in the past for various things (with great success!)... but not for Visual Studio dev environment/deployment stuff... but this has recently "gotten brighter on my radar" of things to look into. It may not be a high priority for this project/effort at this time... but if others have interest in this, I am also definitely interested! I think that Docker/containers (for development and deployment) is an important (and growing) topic! |
Beta Was this translation helpful? Give feedback.
-
Cool. I will see if I can get a basic docker container going this week. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As @harperjohn pointed out it can be a frustration to update the SQL server name within appsettings.json each time you pull a new branch etc.
To avoid this I've removed appsettings.Development.json from the repository and added it to the gitignore file so it won't be tracked going forward.
I've updated the getting started instructions to advise that an appsettings.Development.json should be created and what value needs to be changed.
It should now be the case that once you do this your appsettings.Development.json file will remain constant even if you switch branches etc.
To test this you can fetch the main branch, create the appsettings.Development.json file, update the server name and then switch to the application-branding branch.
All going well your appsettings.Development.json will remain present and unchanged.
Let me know if the above works for you and whether you see any problems with the above approach.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions