Having finally upgraded my Azure solution to 1.8, I immediately encountered a crash when one of my web roles was starting. My unity configuration section had disappeared and could not be loaded! I hadn’t changed anything else so had no idea what was causing the problem. All the configs looked right and were in the right place. Looking at the config URI of the config host for the ConfigurationManager, it was pointing to ‘csxDebugrolesMvcWebRole1basex64WaIISHost.exe.config’.
Finally after looking at the path for the config file and checking the contents, I saw that it was just using a standard WaIISHost.exe.config! So something changed with 1.8. A quick search led me to this helpful blog post, detailing a workaround.
When running locally, to get any settings that you needed you would have to add them to a file called WaIISHost.exe.config and off you go. But this doesn’t work for 1.8. Instead you need to name your debug config file the same as the project it’s in (or at least the name of the generated assembly of that project). So if you’re creating an assembly called ‘MyWebRoleAssembly.dll’ then the config file should be ‘MyWebRoleAssembly.dll.config’.
Now the config URI is pointing to csxDebugrolesMvcWebRole1approotbinMvcWebRole1.dll.config. Much better!