Community blog feed

Modifying web.configs on the fly in Windows Azure

Website
Blog
.NET, Silverlight, and other ramblings
Posted
04 Jul 2009 at 15:19

Summary

This has caught me out often enough that I should blog about it. If you are working with a web role in Windows Azure your web project is copied into the bin directory of your cloud project and is ran from there.  This allows the Windows Azure Development environment to simulate running within the cloud. If you need to therefore modify a web.config setting then modifying your web.config on the fly from your source file won’t make the slightest bit of difference. You need to either modify the web.

Post extract

This has caught me out often enough that I should blog about it.

If you are working with a web role in Windows Azure your web project is copied into the bin directory of your cloud project and is ran from there.  This allows the Windows Azure Development environment to simulate running within the cloud.

If you need to therefore modify a web.config setting then modifying your web.config on the fly from your source file won’t make the slightest bit of difference.

You need to either modify the web.config in the bin directory of your cloud project, or stop and re-run your role again.

In my case, I was messing with the maxRequestLength attribute of the httpRuntime element.

AddThis

Want to stay in touch with what's going on? Follow us on twitter!