Tuesday, September 28, 2010

Missing Windows Azure Assemblies

With all installations the developer needs to make sure that all the components to run the software are on the machine where their software is too run; Windows Azure is no exception. This article explains how to check all your assemblies before you upload using a Windows Azure Web Role that I wrote called Azure GAC Viewer.  The web role lists all the assemblies in the Windows Azure GAC and evaluates uploaded Visual Studio Project file; removing the guessing out of the process.

 

When I ship software as a running Windows application (think install on your desktop box), I check to make sure all the dependencies are either already on the box or installed as part of our installation; these include the right runtime libraries, third party DLLS, etc. Usually this is done with installation software like InstallShield.

 

With Windows Azure we need to make sure that all the assemblies that are not already installed on Windows Azure are included in the package that is uploaded to Windows Azure. What assemblies does your application have access to on Windows Azure? Only those in the global assembly cache and the assemblies uploaded in your package.

 

Secondary, we also need to make sure that we are not sending assemblies to Windows Azure that is already has, since this will make our packages bigger and increase our upload time.

The Problem

If Windows Azure can’t find all the assemblies that your code references it will not be able to load your application, nor will it be able to call any of the methods in your application. Basically the code cannot load into the process space. This means that any diagnostics calls in the application will not be called. It is very similar to running a Windows application where a DLL is present, no code gets called.

 

If you are missing an assembly your deployments will cycle between initializing, busy and stopping states.

 

To solve the problem: if your Windows Azure role relies on any assembly that is not part of the .NET Framework 3.5 or the Windows Azure managed library (listed here), you must explicitly include that assembly in the service package that you upload.

Visual Studio

Before you build and package your service, verify that: The Copy Local property is set to True for each referenced assembly in your project that is not listed here as part of the Windows Azure SDK or the .NET Framework 3.5, if you are using Visual Studio.

 

clip_image001

 

If you are not using Visual Studio, you must specify the locations for referenced assemblies when you call CSPack. See CSPack Command-Line Tool for more information.

A Faster Way

There is a faster way to check your Visual Studio project files just upload the .csproj or .vbproj file to this web site. It will parse the project file, check your references and report back anything that is missing. That way you don’t need to do a line by line comparison of all your references.

Summary

Do you have a better way to accomplish the same thing? Post it in the comments below. Do you have questions, concerns, comments? Post them below and I will try to address them.

 

{6230289B-5BEE-409e-932A-2F01FA407A92}

5 comments: