.net 找不到程序集';Microsoft.IdentityModel“;azure上的错误

.net 找不到程序集';Microsoft.IdentityModel“;azure上的错误,.net,asp.net-mvc-3,azure,.net,Asp.net Mvc 3,Azure,我正在为我的MVC3 web应用程序使用ACS身份验证。它在我的本地计算机上运行良好。但当我将其上载到Azure时,我收到了此错误。我设置CopyLocal=True,请帮助 Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Description: An unhandled exception occurre

我正在为我的MVC3 web应用程序使用ACS身份验证。它在我的本地计算机上运行良好。但当我将其上载到Azure时,我收到了此错误。我设置CopyLocal=True,请帮助

Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

您的Azure计算机可能缺少。有关此的详细信息。复制本地,即确保Microsoft.IdentityModel.dll位于bin目录中,除非您的代码使用RoleEnvironment API,否则将正常工作。如果是这种情况,您将遇到以下已知问题:

在这种情况下,Microsoft.IdentityModel需要存在于Azure VM的GAC中。要完成此任务,请使用启动任务。这篇文章描述了实现这一点的两种方法:


我在微软工作。由于点击率低,我们已经在hh403974.aspx上删除了这篇文章,但是我看到它仍然从这个线程中获得了一些推荐,所以我将在下面粘贴这篇文章的内容

调用RoleEnvironmentAPIs时找不到程序集“Microsoft.IdentityModel”

适用于:适用于SDK1.3,以后使用完整的IIS Web角色和Windows身份基础。 症状:在第一次调用RoleEnvironment方法时遇到以下异常

[序列化异常:找不到程序集'Microsoft.IdentityModel,版本=3.5.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35'

原因:Windows身份基础程序集未正确安装到Azure虚拟机。

解决方案:使用启动任务在虚拟机上重新安装


有关使用启动任务的详细信息,请参阅Azure中的。

是的,Azure计算机是基本的Windows 2008或Windows 2008 R2计算机,带有.NET 3.5/4.0。它们没有像WIF那样的额外运行时。您的应用程序显然是通过与ACS的身份验证或其他方式来利用这一点的。通过将该dll引用的“Copy Local”属性设置为true,确保将此程序集包括在包中。链接的更新文件不起作用:安装程序遇到错误:0x80096002。消息签名者的证书无效或找不到。