Windows Azure | Unable to Find Assembly ‘Microsoft.IdentityModel’

Have you encountered the following exception when you browse to your application running on Windows Azure platform.

Unable to find assembly 'Microsoft.IdentityModel, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'


Cause: The Windows Identity Foundation assemblies are not properly installed to the Windows Azure virtual machine.

Resolution: Use a startup task to reinstall the Windows Identity Foundation package on the virtual machine.


1.  Download the WIF.msu file from this link : 

     Windows6.1-KB974405-x64.msu (Windows Server 2008 R2) for osFamily="2"

     Windows6.0-KB974405-x64.msu (Windows Server 2008) for osFamily="1"


2.  osFamily property can be set in serviceconfiguration file.

     osFamily="2" - Specifies the OS family that is substantially compatible with Windows Server 2008 R2.

     osFamily="1" - Specifies the OS family that is substantially compatible with Windows Server 2008 SP2.

     Please refer this link:



3.  Add the WIF.msu to your project and set “Copy to Output Directory Always” to “Copy Always”.

     Run a MSU update package using the following startup task.

     Note : Use Windows6.1-KB974405-x64.msu package if you specify osFamily="2"

               Use Windows6.0-KB974405-x64.msu package if you specify osFamily="1"

     (RegisterDLL.cmd and set copy local = true)

                   @echo off

                   sc config wuauserv start= demand

                   wusa.exe "Windows6.1-KB974405-x64.msu" /quiet /norestart

                   sc config wuauserv start= disabled

                   exit /b 0




4.  Add the below script in the serviceDefinition file.


           <Task commandLine="RegisterDLL.cmd" executionContext="elevated" taskType="simple" />



Deploy the package on windows Azure platform.

Do a remote desktop to the VM and you will notice that "Microsoft.IdentityModel" assembly is available in GAC.



Refer the below link :


Comments (3)

  1. Brian Leung says:

    I managed to do a remote desktop to the VM.  How do you list all the assemblies available in GAC in remote desktop?


    – brian

  2. Sri Harsha says:

    Follow the below steps to list all the assemblies available in GAC:

    Start -> Run -> Cmd -> assembly

  3. Mahesh Wankhade says:


    My azure VM is running with Windows Server 2012.

    Will this solution will also work for Windows Server 2012(I believe Windows Identity Foundation is built into Windows Server 2012).

    If yes then what changes I will have to make ?

    If not then what will be the other solution ?

    Thanks in Advance,


Skip to main content