Explore Courses Blog Tutorials Interview Questions
0 votes
in Azure by (45.3k points)

I have an 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 DEV enviroment, and when publishing the web.config for PROD must be used.

What is the best way to do this ?

Currently, I am facing issues when using a Web.Debug.config with transform XSLT. It doesn't seem to work in Azure.

1 Answer

0 votes
by (16.8k points)

Solve your problem a different way. Think about the web.config always being static and never changing when working with Azure. What does change is your ServiceConfiguration.cscfg.

What we have done is created our own configuration provider that first checks the ServiceConfiguration.cscfg and then falls back to the web.config if the setting/connection string is't there. This allows us to run servers in IIS/WCF directly during development and then to have different settings when deployed to Azure. There are some circumstances where you have to use web.config (yes, I'm referring to WCF here) and in those cases you have to write code and create convention instead of storing everything in web.config. I have a blog post where I show an example of how I did this when dealing with WIF (Windows Identity Foundation) and Azure.

Browse Categories