2014-08-28 178 views
0

我得到以下事件查看器中的异常与ADFS 2.0和MVC通过Visual Studio的身份和访问工具配置4应用程序,没有行号的应用程序在IIS 7.5上运行CryptographicException在堆栈跟踪

Exception type: CryptographicException 
Exception message: Key not valid for use in specified state. 

我无法重现错误。它在我们的公共网站上间歇性发生,我通过事件查看器看到它。

即使这是一个单一的服务器部署和不涉及养殖场(除ADFS有一个小学和一个代理服务器),只是为了起见,我通过阅读这篇文章http://www.cloudidentity.com/blog/2013/01/28/running-wif-based-apps-in-windows-azure-web-sites-4/

上述启用Web场饼干异常消失,但现在以相同的间歇频率出现:

Exception type: CryptographicException 
Exception message: Error occurred during a cryptographic operation. 

事件查看器的堆栈跟踪中没有行号。在这个应用程序中的任何其他例外给出一个行号,这一个没有。如果我没有行号,我怎么才能找出哪些代码导致这个异常?就像我说的我不能重现它,所以没有使用调试,或者是它?

编辑

我注意到有在web.config中的关键节点下的两个元素。我不需要一个吗?

<system.identityModel> 
    <identityConfiguration> 
     <issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry"> 
      <authority name="http://our-FS-server/adfs/services/trust"> 
       <keys> 
       <add thumbprint="abcd" /> 
       <add thumbprint="efgh" /> 
       </keys> 
      </authority> 
     </issuerNameRegistry> 
    </identityConfiguration> 
</system.identityModel> 

回答