【问题标题】:Method not found: 'Void System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'找不到方法:'无效 System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'
【发布时间】:2016-11-15 16:49:00
【问题描述】:

我正在将一个站点从一台在 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

【问题讨论】:

  • 解释您的应用程序的功能、描述特定场景并发布一些代码可能会有所帮助。我只知道您正在“迁移”您的网站。
  • 谢谢。不幸的是,我对它不是很熟悉。我意识到我在这里抓住了稻草。当我尝试登录时会显示此特定消息。我会看看是否可以挑选出相关代码,但其中很多是编译的,我没有原始源代码。
  • 我对它的了解不如你,而且我没有来源。 :)

标签: c# asp.net security iis


【解决方案1】:

我在我们的一台 Windows 2012 r2 服务器中遇到了同样的问题。使用表单身份构建的 MVC 应用程序抛出错误。

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

我们卸载了补丁,重新启动了服务器,然后瞧。一切都运行良好

【讨论】:

    【解决方案2】:

    我能想到三个原因:

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

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

    3. 这可能是安全/权限问题。尝试将 IIS 中的应用程序池更改为以管理员身份运行,如果问题消失,则说明权限问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-15
      • 2010-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多