Sunday, April 22, 2012

Visual Studio 2010 Just In Time Debugger - Cryptographic Exception


A couple of weeks ago, Visual Studio 2010 started giving Just-In-Time debugger message as shown below:

It was not a code issue because we got this debugger message just after VS 2010 is started and frequently in middle of coding.

The issue was because of Forefront Identity Manager service. It was disabled in my server. Just enable it and set it to start Automatically.

After this was done, we never got the above debugger message. More details on the issue can  be found here.


Saturday, April 21, 2012

The RPC server is unavailable


After the ABCPDF's issue with IE9 is resolved, we got another issue while generating PDF using ABCPDF.dll. The below is the error message:

Source:System.Drawing, Message:The RPC server is unavailable, StackTracke:   at System.Drawing.Printing.PrinterSettings.get_InstalledPrinters()     at WebSupergoo.ABCpdf8.Doc.AddHtmlGecko(String html, Boolean paged, Int32 width, String& err)     at WebSupergoo.ABCpdf8.Doc.AddImageHtml(String html, Boolean paged, Int32 width, Boolean disableCache)     at WebSupergoo.ABCpdf8.Doc.AddImageHtml(String html) 


Make sure that the PrintPool service is running on your server. By default, it was disabled in my SharePoint server. I enabled and set it to start automatically and was able to generate PDF from then.

Cheers !

ABCpdf stopped working after IE9 is installed

Hi All,

We use ABCPDF to generate PDF out of a SharePoint data. The version we use is Till now, everything worked fine and suddenly, ABCPDF stopped working with the below error message:

"ABCpdf could not initiate MSHtml engine for this version of Internet Explorer installed."

The only change done to the server was that IE9 is installed. According to the WebSuperGoo support team, ABCPDF versions below 8.1 do not support IE9. The below is the explanation:

Using IE9 on the same system as older ABCpdf versions may cause this error message. The current release - ABCpdf 8.1 - is fully compatible with IE9 and also provides a new Gecko-based HTML engine.

When converting HTML to PDF, ABCpdf uses the MSHTML component installed with Internet Explorer as the first stage of the process. The issue when using older ABCpdf versions is related to a set of problems Microsoft introduced in IE9. We (and other developers) reported these issues to Microsoft in September 2010 but unfortunately they have not been fixed.

Unfortunately with the official release of IE9 Microsoft released new documentation which says the IHTMLElementRender::DrawToDC function that was required has been deprecated. This is especially unfortunate given that there is no replacement for this function.

Given that Microsoft appears to be unwilling to support these interfaces we would strongly recommend that on new deployments you consider a move to the new Gecko-based HTML engine available in ABCpdf 8. It is just one line of code to select the Gecko rendering engine (see the Doc.HtmlOptions.Engine property).


Change the Rendering Engine from MSHtml to Gecko by using the below code:
Doc theDoc = new Doc();
theDoc.HtmlOptions.Engine = EngineType.Gecko;
After this issue is resolved, we got one more error which says "The RPC server is unavailable"

Sunday, April 1, 2012

Error occurred in deployment step 'Retract Solution': A timeout has occurred while invoking commands in SharePoint host process

Hi All,

We got this error when trying to deploy the SharePoint solution using Visual Studio 2010.

Error occurred in deployment step 'Retract Solution': A timeout has occurred while invoking commands in SharePoint host process

To resolve this error, make sure the following checks are made:

1. Make sure that Application Pool corresponding to the site on which deployment made is up and running.

2. Restart the Visual Studio and reset the IIS if necessary.

We did the above steps and issue got resolved.


Thread Exception while trying to use HttpContext.Current.Response.End()

Hello All,

We frequently got Thread Exception when using HttpContext.Current.Response.End(). The error is shown below:

Source:mscorlib, Message:Thread was being aborted., StackTracke:   at System.Threading.Thread.AbortInternal()     at System.Threading.Thread.Abort(Object stateInfo)     at System.Web.HttpResponse.End()

This is a known issue when we use methods like HttpContext.Current.Response.End(), HttpContext.Current.Response.Redirect() and Server.Transfer() (Refer Microsoft Support)

The workaroud is to use HttpContext.Current.ApplicationInstance.CompleteRequest instead of Response.End()

Cheers !