Troubleshooting!

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);

Solutions:

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

2. Keyset does not exist

Solutions:

http://stackoverflow.com/questions/602345/cryptographicexception-keyset-does-not-exist-but-only-through-wcf

http://msdn.microsoft.com/en-us/library/aa702621.aspx

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

Solutions:

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


<httpRuntime requestValidationMode="2.0"/>

http://social.msdn.microsoft.com/Forums/en-US/Geneva/thread/b6428ea6-e705-4c66-a6fe-8e9f51f73311

http://volkanuzun.com/blog/post/2010/10/14/A-potentially-dangerous-RequestForm-value-was-detected-from-the-client-(wresult3d3ctrustRequestSecuri).aspx

ASP.NET Error pages

That is interesting that my previous post talked about error pages in asp.net 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

http://stackoverflow.com/questions/619895/how-can-i-properly-handle-404-in-asp-net-mvc/7967759#7967759

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

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