asp.net-mvc - 访问控制服务和Azure网站无法加载System.IdentityModel.Services

标签 asp.net-mvc azure wif acs

我在 Windows 8 发布预览版上使用 Visual Studio 2012 RC 创建了一个 ASP.NET MVC 4 应用程序。我下载并安装了 WIF 工具包,并使用解决方案菜单中的“身份和访问”选项添加我的访问控制服务元数据端点。本地测试一切正常。然而,当我部署到我的免费 azure 网站时,我收到黄色屏幕:

"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."

这些程序集未在项目中引用,因此我添加了它们,发送到 bin 文件夹的输出并重新部署。然后我收到一条关于程序集可能被篡改的消息。有谁知道如何克服这个问题吗?

编辑 添加本地会导致此错误

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)

在网络配置中,模块被定义为

<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>

谢谢

最佳答案

System.identityModel.Services 是 .NET Framework 4.5 namespace没有 .NET Framework 4.0 版本。 Windows Azure 网站不支持 .NET Framework 4.5。

关于asp.net-mvc - 访问控制服务和Azure网站无法加载System.IdentityModel.Services,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11595684/

相关文章:

javascript - 如何使用 jQuery 等待替换

c# - 从 ASP.Net MVC 中的变量生成 href 值

asp.net-mvc - WebApp-WebAPI-OpenIDConnect-DotNet 未部署在 azure 上

azure - 我可以使用 Azure Bastion 隧道进入我的 CosmosDB 吗?

amazon-web-services - AWS 和 Azure 区域和可用区列表

iis-7 - 是否可以在没有 LoadUserProfile = True 的情况下运行 WIF

javascript - ASP.NET MVC RedirectToAction 在 View 中的 AJAX 发布后不起作用

azure - 自动删除 Azure 暂存服务

wif - 如何将 federationConfiguration 从 web.config 移至某个自定义配置文件并通过代码动态加载

.net - web.config 中以 ida 为前缀的 appSettings 键的用途