找不到方法:'Void System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'

时间:2016-11-15 16:49:01

标签: c# asp.net security iis

我正在将站点从Windows Server 2008 R2 Standard上运行IIS 7.5的一台Web服务器迁移到Windows Server 2012 R2上的一台IIS 8.5。我目前收到以下消息。我知道System.Security.Claims应该在mscorlib.dll中并且似乎已经存在。我不确定在提出这个问题时还有什么其他帮助,但如果有人有想法指出我正确的方向,那就太棒了!谢谢!

  

'/ profile'应用程序中的服务器错误。

Method not found: 'Void System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'.
  

说明:执行期间发生未处理的异常   当前的网络请求。请查看堆栈跟踪了解更多信息   有关错误的信息以及它在代码中的起源。

     

异常详细信息: System.MissingMethodException:找不到方法:   “无效   System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)”

     

来源错误:

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.
  

堆栈追踪:

[MissingMethodException: Method not found: 'Void System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'.] 
System.Web.Security.FormsIdentity..ctor(FormsIdentity identity) +0             
System.Web.Security.FormsIdentity.Clone() +35    
System.Security.Principal.GenericPrincipal.AddIdentityWithRoles(IIdentity identity, String[] roles) +57
System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e) +338    
System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +88    
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+80    
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161
  

版本信息:Microsoft .NET Framework版本:4.0.30319;   ASP.NET版本:4.6.1069.1

2 个答案:

答案 0 :(得分:1)

我在我们的一个Windows 2012 r2服务器上遇到了同样的问题。使用表单标识构建的MVC应用程序会抛出错误。

我们发现某个特定的Microsoft更新补丁(KB3098785)导致了此问题。

我们取消了修补程序,重新启动了服务器并且瞧瞧......一切运行正常

答案 1 :(得分:0)

我可以想到三个原因:

  1. 您错过了应用程序所需的DLL。可能需要在服务器上安装库或框架。

  2. 也许您的两台服务器正在运行不同版本的.NET框架。检查两台服务器并查看它们的版本,所有详细信息都可在此MSDN文章中找到:https://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx

  3. 它可能是安全/权限的事情。尝试更改IIS中的应用程序池以作为管理员运行,如果问题消失,则是权限问题。