I was faced with an interesting problem and the end of last week that caused me to spend way too much time troubleshooting.

A Windows Azure solution is a collection of projects with your Cloud Project being the top and most important.  If you’re creating a web site, you’ll have at least one Web Role project that is, for all intents and purposes, an ASP.NET web site.

This is where things went rather wrong.  We added a Silverlight project to our solution and about the same time, the Startup Project for the solution changed from the Cloud project to our Web Role.

What does that mean to the average developer?  Well, it turns out that “it dependsâ€? is the answer.

If your Cloud project is not set as the Startup Project then your application may or may not properly launch the Azure Development environment.  I say may because I found that some things worked, or at least didn’t report an error, while other things reported errors that may no sense at all.

Specifically, I was receiving the following error when I attempted to insert a message into a queue:

ConfigurationSettingSubscriber needs to be set before FromConfigurationSetting can be used

For one, this error message is incorrect.  It is actually the ConfigurationSettingPublisher that has the issue. I did not get an error on code concerning the use of the ConfigurationSettingPublisher, I actually received the message when I attempted to connect to a queue.

I had copied the code exactly from a perfectly functioning demo application that is part of the Windows Azure Platform Training Kit.  But it still didn’t work in my project.

Finally, after much time and troubleshooting I happened to notice that our Web Role was set as the Startup Project which, it turns out, is a bad thing.

Bill Lodin has an article where he mentions this and is the one that finally led me down the path to finding and fixing my problem.

I reset the Startup Project to our Cloud project and we’re back in business.

I just wish Microsoft had made the errors a little clearer.

Note: Microsoft just released version 1.1 of the Azure SDK so I’ll install it to see if anything has changed.