Monday, February 21, 2011

Cryptographic exception when running SharePoint 2010

I was just recently setting up a SharePoint 2010 Development Environment and shortly after installing SharePoint 2010, I started seeing numerous Cryptographic exception error messages each time I attempted to browse to a page in SharePoint.

As it turns out, this error message seems to appear because of the manner in which I set up my development environment.  Since I was working with Claims Based Authentication, I had installed Visual Studio 2008 with SP1 prior to installing my SharePoint 2010 environment.  Due to some flags with the Microsoft.Net Framework Debugger, I started seeing this Cryptographic exception error messages constantly appearing asking me if I wanted to debug the exception with Visual Studio 2008.

Fortunately, I found an article which addressed this very issue:

http://blogs.technet.com/b/stefan_gossner/archive/2010/05/10/common-problem-with-sharepoint-2010-system-security-cryptography-cryptographicexception-keyset-does-not-exist.aspx

After reading the article, I deleted the specified registry keys and re-booted the machine to ensure that all of the necessary SharePoint Services recognized the deleted registry keys.

For those of you who might prefer to run a script to automatically remove the necessary registry keys, I have provided the VBScript that I have used to perform this operation:

Call DeleteDebugRegistryKeys()

Sub DeleteDebugRegistryKeys()
 Dim objWSH

 Set objWSH = CreateObject("WScript.Shell")

 'Delete the 32-bit Registry Keys
 objWSH.RegDelete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger"
 objWSH.RegDelete "HKLM\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger"

 'Delete the 64-bit Registry Keys
 objWSH.RegDelete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger"
 objWSH.RegDelete "HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger"

 Set objWSH = Nothing

End Sub

Simply copy and paste the script below into a file saved with the .vbs extension and you should be able to execute it on your problematic SharePoint 2010 server.


The next time I attempted to access SharePoint 2010 through the browser, voila!; the exception messages no longer appeared!

No comments:

Post a Comment