Change connection string from development to production when publishing

后端 未结 4 1137
野性不改
野性不改 2021-01-13 09:03

I want to know how to change automatically the connection string of my app so when I\'m working on it in my pc, it uses my local SQL Server and once I publish it then uses t

4条回答
  •  独厮守ぢ
    2021-01-13 09:58

    you can split your web.config like

    • web.dev.config
    • web.live.config

    At deployment time choose appropriate config file. You can visit this link to learn how to manage multiple web.config file in single project.

    OR

    If you don't want to create multiple web.config files refer Single web.config file across all environments (dev, test, prod) from codeproject

提交回复
热议问题