Bug in Windows Azure Toolkit for Windows Phone 7

I was recently working on preparing for a a presentation where I would demonstrate some of the features of the Windows Azure Toolkit for Windows Phone 7.  I’ve used the toolkit in the past, but not for probably a few months.  I know the team that put this toolkit together has made some great updates, so I was eager to try the latest bits.

I installed the tools and fired up a new Windows Phone 7 Cloud Application.  I proceeded to hit F5 in Visual Studio to launch the app (WP7 application and web admin project).  When trying to start up the web project, I was presented with an unhandled COMException from the WebRole class.  The Microsoft.Web.Administration.ServerManager class was raising this exception:

“Retrieving the COM class factory for component with CLSID {815183DD-75F9-42DF-8E57-C8B57692F134} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).”

ServerManager - COM ExceptionI checked the troubleshooting guide and found no reference of this error.

With the help of the great Wade Wegner, I was able to get past this problem.  Apparently if you have both IIS 7.5 Express and IIS 7 installed, you may get this error.  The solution is quite easy – you’ll need to modify your web project to reference a specific version of the Microsoft.Web.Administration assembly.  From Visual Studio you can unload your web project and then edit the project file (in my screenshot that would be the “WP7CloudApp2.Web.csproj” file).  You’ll need to change

<Reference Include="Microsoft.Web.Administration" />

to

<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

Save and reload your project.  You should now be good to go!

The team that works on this toolkit at Microsoft is aware of the problem and are working to resolve it by the next toolkit release.  In the meantime, please use the workaround mentioned here and continue to use this most excellent toolkit for Windows Azure and Windows Phone 7.

Advertisements