Azure web.config per environment

前端 未结 5 1883
春和景丽
春和景丽 2020-12-17 07:54

I have a Azure project (Azure 1.3) in VS2010. There are 2 webroles, one web page project and one WCF project. In debug mode I want the web project to use a web.config for DE

5条回答
  •  不知归路
    2020-12-17 08:39

    I like this question !

    For worker roles, I solved this problem by detecting the environment at runtime and launching my 'application' in a new AppDomain with a custom configuration :

    • bot.cloud.config
    • bot.dev.config
    • bot.win.config

    This is incredibly efficient !

    I'd like to do the same with web projects, because using the Azure specific configuration is a lot of trouble :

    • Both config are not in the same place, which is time-consuming when debugging
    • You have to learn a new way of writing something that sould be standard
    • Sometime you'll wonder if the app falled back on web.config because of a stupid syntax error

    I'm still searching the right way to do that, like in this post

提交回复
热议问题