2014-08-28 177 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> 

回答