首页 新闻 会员 周边 捐助

CryptographicException: 该项不适于在指定状态下使用

0
悬赏园豆:20 [待解决问题]

Server Error in '/' Application.


 

该项不适于在指定状态下使用。

             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.Security.Cryptography.CryptographicException: 该项不适于在指定状态下使用。
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.                  

Stack Trace:

[CryptographicException: 该项不适于在指定状态下使用。
]
   System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope) +318
   System.IdentityModel.ProtectedDataCookieTransform.Decode(Byte[] encoded) +52

[InvalidOperationException: ID1073: A CryptographicException occurred when attempting to decrypt the cookie using the ProtectedData API (see inner exception for details). If you are using IIS 7.5, this could be due to the loadUserProfile setting on the Application Pool being set to false. ]
   System.IdentityModel.ProtectedDataCookieTransform.Decode(Byte[] encoded) +167
   System.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie, Boolean outbound) +123
   System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) +575
   System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(Byte[] token, SecurityTokenResolver tokenResolver) +76
   System.IdentityModel.Services.SessionAuthenticationModule.ReadSessionTokenFromCookie(Byte[] sessionCookie) +409
   System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken& sessionToken) +187
   System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +126
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
                  

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18055                 

该问题,是在客户端出现。请高手帮忙,若要提供其他的信息也请留言。网上找的答案没有解决掉问题。

服务器:Windows Server 2008 R2

.Net : 4.0

使用的证书是:IIS Express Development Certificate CN=localhost CN=localhost

开发环境无法重新问题。

< >
分享
所有回答(1)
0

IIS-》应用程序池-》将ApplicationPoolIndentity 改成 LocalSystem

EricWen | 园豆:179 (初学一级) | 2016-11-22 01:22
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册