WaIISHost.exe.config does not work with Windows Azure SDK 1.8

In the absence of an app.config working with the RoleEntryPoint implementation in a web role, a well-known workaround many people have taken, has been to include a WaIISHost.exe.config file in their project.  The background on this approach, and internal details can be found here.  If you are using this approach, and have moved to the recent version of the Windows Azure SDK, version 1.8, you may have noticed this no longer works as it did with the previous versions.

We recently had some customers using this approach, now migrating to Windows Azure SDK 1.8, only to find that their application settings in WaIISHost.exe.config were no longer available to the code running in the RoleEntryPoint implementation.  No, the process name has not changed and at some later point I will find some time to go in to more of the details that we have found changed.  For now I just wanted to provide yet another workaround that works with SDK 1.8, for those of you that may have run in to this.  There are situations, such as with some 3rd party dependencies that prevent us from moving all of our configuration settings in to .cscfg, or even to code, and some settings really don’t need to be there anyway.

The workaround. It’s actually quite simple.

Basically we rename the WaIISHost.exe.config to the name of the output assembly containing the RoleEntryPoint implementation in your web project, with the addition of the .config extension, of course. So for a web application project named “MyApp.Web” and assembly name of “MyApp.Web” we renamed the WaIISHost.exe.config to MyApp.Web.dll.config.  If you are going to add this file to a new project, don’t forget to set the “Copy to Output Directory” property to “Copy Always”.

Hope this helps

Leave a Reply