1. m_safeCertContext is an invalid handle

I got this issue when try to assign a X509SigningCredentials to the custom STSConfiguration.

this.SigningCredentials = new X509SigningCredentials(cert);


Make sure don’t call cert.Reset() before passing the cert to X509SigningCredentials constructor

2. Keyset does not exist


3. A potentially dangerous Request.Form value was detected from the client (wresult=”<trust:RequestSecuri…”).


Make sure you have this setting in your web.config (under system.web)

<httpRuntime requestValidationMode="2.0"/>

ASP.NET Error pages

That is interesting that my previous post talked about error pages in and yesterday I got this (see image below) when I tried to access blackberry online shopping site

That is good to know that this website is built using ASP.NET MVC, WCF and a Controller-Service-Repository pattern, so instead of disappointed cause the website crashed, I felt like this is built by some of my “friends” :)

PS: the good news is it was fixed right after that!

404 on MVC

If you are running IIS 7.x, there is a very simple solution to handle 404 (Page Not Found). I found this solution from

<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" />
<error statusCode="404" responseMode="ExecuteURL" path="/Error/PageNotFound" />

Crystal Reports 64 bits issue

The error below happen on a 64 bits web server that tries to load the crystal reports run-time. If this sounds familiar with you and you already installed the “CRRedist2008_x64.msi”.  But it still didn’t work and you starting to get tired with google :-)

You should look into your application pools settings, make sure you set the “Enable 32 bits Applications” to FALSE