Steve Spencer's Blog

Blogging on Azure Stuff

Deploying Access Control Service enabled web application in Windows Azure

When deploying an Access Control Service enabled web application from my development environment to Windows Azure I got the following error:

“Unable to find assembly ‘Microsoft.IdentityModel, Version= . .”


This had worked well when running in the development fabric on my machine so it was strange that it failed when deployed to Windows Azure. The reason why this file cannot be found is because on my machine it is installed in the GAC and it is not in the GAC when deployed in Azure. There is a simple way to fix this and it is by configuring a Start-up task in your ServiceDefinition.csdef file to install the Microsoft.IdentityModel assembly in the GAC. When a new instance is created within Windows Azure the start up task will be run to allow things to be installed into the virtual machine prior to running your application.

Steve Marx has written an introduction to Start-up tasks as well as a Tips, Tricks and Gotchas list.


This post explains how to create a Start-up task to add an assembly to the GAC.

Comments (2) -

  • Addison

    10/4/2011 9:21:02 AM | Reply

    The article is very informative and valuable.

  • Rory Primrose

    2/22/2012 4:04:21 AM | Reply

    Alternatively, you can use this assembly as a copy local assembly. Given that you have to upload the assembly anyway, this removes the need to have scripts to add it to the GAC.