Monday, March 16, 2015

JIT Compiler Encountered an Internal Limitation

JIT Compiler Encountered an Internal Limitation

Problem:

When collecting IntelliTrace data or Debugging an ASP.NET Web Application with Visual Studio 2013 you receive the Yellow Screen of Death in the browser that says...
 JIT Compiler encountered an internal limitation.
   at Telerik.Web.SkinRegistrar.GetRuntimeSkin(ISkinnableControl control)
   at Telerik.Web.SkinRegistrar.GetEmbeddedSkinAttributes(ISkinnableControl control, Type controlType, Boolean designTime)
   at Telerik.Web.SkinRegistrar.GetEmbeddedSkinAttributes(ISkinnableControl control, Type controlType)
   at Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl control)
   at Telerik.Web.UI.RadAjaxLoadingPanel.RegisterCssReferences()
   at Telerik.Web.UI.RadAjaxLoadingPanel.ControlPreRender()
   at Telerik.Web.UI.RadAjaxLoadingPanel.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Solution:

In the connect bug related to this issue, you'll see the advice to turn off IntelliTrace or to run your project without debugging. While these two workarounds are effective in getting your site running, they leave a lot to be desired when it comes to being able to get the debug info you may need to solve . In the case above, the compiler is choking on the Telerik assemblies that are part of this web application. In order to keep IntelliTrace and Debugging working, you need to do two things depending on your situation...

Visual Studio Debugging:

1) Open Visual Studio
2) Select Tools --> Options...
3) On the left side of the Options dialog, Select IntelliTrace --> Modules
4) Click Add...
5) Type PublicKeyToken:121FAE78165BA3D4
6) Click Add to dismiss the Add a Pattern dialog
7) Click OK to dismiss the Options dialog


IntelliTrace Stand-alone Collector:

1) Open the Collection Plan XML file you are using for your trace. (i.e. collection_plan.ASP.NET.trace.xml)
2) Add a child element to the <ModuleList isExclusionList="true"> element, this child element should be: <Name>PublicKeyToken:121FAE78165BA3D4</Name>

I hope this can prevent someone else from wasting time trying to track this down. If your error is not related to the Telerik assemblies, you can always change the Public Key Token to that of the assembly which is causing trouble in your particular case.

Thursday, June 14, 2012

Managing Private Key Access for Certificates in Windows Server 2003

Managing Private Key Access for Certificates in Windows Server 2003

Problem:

The Certificates Snap-in for the Microsoft Management Console in Windows Server 2003 does not allow you to "Manage Private Keys...", which makes it impossible to grant user accounts access to a certificate's private key using the Certificates Snap-in.

Solution:

The only option to assign the necessary permissions is the WinHttpCertCfg.exe console application that is part of the  Windows Server 2003 Resource Kit Tools.

  1. Open a command prompt to the location where you have installed the Windows Server 2003 Resource Kit Tools.
  2.  We are going to use the winhttpcertcfg.exe utility to view the accounts that already have access to the certificate's private key, and also to grant permissions to additional accounts.
  3. To view the list of accounts that have access to the certificate's private key, use the following syntax:
    • winhttpcertcfg -l -c [Certificate Store Name] -s [The Name of the Certificate] 
    • Example: winhttpcertcfg -l -c LOCAL_MACHINE\My -s "Named Server Certificate"
  4. To grant an additional account access to the certificate's private key, use the following syntax:
    • winhttpcertcfg -g  -c [Certificate Store Name] -s [The Name of the Certificate] -a [UserName]
    • Example: winhttpcertcfg -g -c LOCAL_MACHINE\My -s "Named Server Certificate" -a ADDomain\ADUserName
  5. After granting the permissions that are required, you can immediately re-issue the command to list the accounts that have access. The result should now contain the account(s) you added in step 4.

References:

Windows Server 2003 Resource Kit Tools
WinHttpCertCfg.exe, A Certificate Configuration Tool

Friday, May 18, 2012

Visual Studio 2010 Hangs on Load

Visual Studio 2010 Hangs on Load


Problem: 

When loading Visual Studio 2010, the user interface freezes displaying "Loading toolbox content from package" followed by a component name and a GUID as picutred below...



Solution:

  1. Exit Visual Studio
  2. Navigate to the affected user's profile folder, i.e. c:\Users\[UserName]
  3. Beneath the user's profile folder, you should find \AppData\Local\Microsoft\VisualStudio\10.0
  4. Locate the file toolbox.tbd and rename it to toolbox.old.
  5. Run Visual Studio, after a few minutes the UI will became responsive which indicates that it completed rebuilding the toolbox.tbd file, which should now be smaller.

 References:

 Similar Microsoft Connect Bug and Workaround