Using different Web.config in development and production environment

前端 未结 10 2180
梦如初夏
梦如初夏 2020-11-22 12:50

I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment.

<
10条回答
  •  春和景丽
    2020-11-22 13:27

    This is one of the huge benefits of using the machine.config. At my last job, we had development, test and production environments. We could use the machine.config for things like connection strings (to the appropriate, dev/test/prod SQL machine).

    This may not be a solution for you if you don't have access to the actual production machine (like, if you were using a hosting company on a shared host).

提交回复
热议问题