Managing A Debug and Release Connection String

前端 未结 9 1332
北海茫月
北海茫月 2021-01-30 18:41

What is a good approach to managing a debug and release connection string in a .NET / SQLServer application?

I have two SQL Servers, a production and a build/debug and I

9条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 19:18

    I usually set an Environment variable on my production servers that denotes the server is a production server. I then read the correct connection string from my web.config based on whether this Environment variable exists and is set to the production value.

提交回复
热议问题