Access control Service and Azure Websites Could not load System.IdentityModel.Services

1

I've created an ASP.NET MVC 4 app using visual studio 2012 RC on Windows 8 release preview. I downloaded and installed the WIF toolkit and used the "Identity and Access" option in the solution menu to add my Access Control Service metadata endpoint. Tested locally and all is well. When I deployed to my free azure website however I get the yellow screen saying

"Could not load file or assembly 'System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified."

These assemblies aren't referenced in the project, so I added them, sent to output to the bin folder and redeployed. I then got a message about the assembly probably being tampered with. Does anyone know how to overcome this?

EDIT Adding local causes this error

Could not load file or assembly 'System.IdentityModel.Services' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

In the web config the module is deinfed as

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
      <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
    </modules>
  </system.webServer>

Thanks

asp.net-mvc
azure
wif
acs
asked on Stack Overflow Jul 21, 2012 by Dylan • edited Jul 21, 2012 by Dylan

3 Answers

1

I think this is a known issue in Azure, you'll need to use a start-up script that runs gacutil.exe to register the IdentityModel.dll.

Follow the steps here: http://blogs.infosupport.com/adding-assemblies-to-the-gac-in-windows-azure/

Edit:
My bad, I thought you were talking about a Web Role. As astaykov said, you can't have start-up tasks in Web Sites. Well maybe this'll help somebody else out :-)

answered on Stack Overflow Jul 21, 2012 by Shahin Dohan • edited Jul 21, 2012 by Shahin Dohan
1

So, you need to explicitly add the Idendity assemblies as references to your web app project, then explicitly set theyr "Copy Local" attribute to "True", then follow this MSDN forums thread and use this session token handler. Read through that blog post.

Following all the steps you will have WIF enabled ACS consuming app, like the one I just created here: http://wawsacs.azurewebsites.net/ (note, this websites will be delete by me on July 25th 2012).

answered on Stack Overflow Jul 21, 2012 by astaykov • edited Jul 21, 2012 by astaykov
1

System.identityModel.Services is a .NET Framework 4.5 namespace with no .NET Framework 4.0 version. .NET Framework 4.5 is not supported on Windows Azure Web Sites.

answered on Stack Overflow Jul 22, 2012 by Neil Mackenzie

User contributions licensed under CC BY-SA 3.0