Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
668 views
in Technique[技术] by (71.8m points)

asp.net - Sitecore - System.Security.Cryptography.CryptographicException

Hi and thank you for your help. We're trying to keep a Sitecore site up and running on a WS 2008 R2 Standard server but keep running into the following exception:

System.Security.Cryptography.CryptographicException

The site is set up to run in its own App Pool with the 2.0 framework version selected and integrated pipeline mode.

The site will run fine for a few minutes but then the app pool ends up being stopped with the following details:

"Application pool '######' is being automatically disabled due to a series of failures in the process(es) serving that application pool."

Checking the Application log show the following:

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/4/ROOT

Process ID: 5156

Exception: System.Security.Cryptography.CryptographicException

Message: The system cannot find the path specified.

StackTrace: at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) at System.Security.Cryptography.SafeKeyHandle._FreeHKey(IntPtr pKeyCtx) at System.Security.Cryptography.SafeKeyHandle.ReleaseHandle() at System.Runtime.InteropServices.SafeHandle.InternalFinalize() at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing) at System.Runtime.InteropServices.SafeHandle.Finalize()

A tip on one site I found said to make sure that the account that the site is running under is a member of the Cryptographic Operators group which I did. Sadly the site continued to fail.

Any help would be appreciated. Thank you!

EDIT

After I implemented the first answer below I took another look at the server Application logs and it looks like every time the app pool goes down the following warning happens first:

Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards.

Event 1530, User Profile Service DETAIL - 2 user registry handles leaked from RegistryUserS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965: Process 3260 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965 Process 3260 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwarePoliciesMicrosoftSystemCertificates

And another example:

Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards.

DETAIL - 13 user registry handles leaked from RegistryUserS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965: Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965 Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965 Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965 Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965 Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftSystemCertificatesTrustedPeople Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftSystemCertificatesrust Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftWindows NTCurrentVersion Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwarePoliciesMicrosoftSystemCertificates Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftSystemCertificatesRoot Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftSystemCertificatesSmartCardRoot Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftSystemCertificatesMy Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftSystemCertificatesCA Process 5228 (DeviceHarddiskVolume3WindowsSystem32inetsrvw3wp.exe) has opened key REGISTRYUSERS-1-5-82-3231641130-1035467585-39029555-2466166849-1382764965SoftwareMicrosoftSystemCertificatesDisallowed

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This might help: Running Sitecore 6 on Windows 7′S IIS.

It basically says to add this in your global.asax:

public void Application_Start() {
  System.Security.Cryptography.RSACryptoServiceProvider.UseMachineKeyStore = true;
  System.Security.Cryptography.DSACryptoServiceProvider.UseMachineKeyStore = true;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...