title: JIT Compiler encountered an internal limitation. VS2008
body: <p>I've been using XslCompiledTransform because Microsoft tells me I need to use as XslTransform is deprecated.</p>
  <p><code>&lt;ExactDatetime&gt;200-02-02&lt;/ExactDatetime&gt;</code>) works using XslTransform</p>
  <p><code>&lt;ExactDatetime&gt;200-02-02&lt;/ExactDatetime&gt;</code>) fail using XslCompiledTransform</p>
  <p><code>&lt;ExactDatetime&gt;&lt;/ExactDatetime&gt;</code>) works using XslTransform</p>
  <p>Works:</p>
  <pre><code>XslTransform xslDoc = new XslTransform(); 
  xslDoc.Load(xslPath); 
  xslDoc.Transform(doc, Response.Output); 
  </code></pre>
  <p>Fails with JIT (When use date example 200-02-02)</p>
  <pre><code>XslCompiledTransform xslDoc = new XslCompiledTransform(); 
  xslDoc.Load(xslPath); 
  xslDoc.Transform(doc, new XmlTextWriter(Response.Output)); 
  </code></pre>
  <p>JIT Compiler encountered an internal limitation.</p>
  <blockquote>
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
  <p>Exception Details: System.InvalidProgramException: JIT Compiler encountered an internal limitation.</p>
  </blockquote>
  <p>Source Error:</p>
  <pre><code>Line 33:            //xslDoc.Transform(doc, Response.Output); 
  Line 34: 
  Line 35:             xslDoc.Transform(doc, new XmlTextWriter(Response.Output)); 
  Line 36:         } 
  Line 37:   } 
  </code></pre>
  <p>Source File: c:\shahid\ccr_test\test1\Default.aspx.cs    Line: 35</p>
  <p>Stack Trace:</p>
  <pre><code>[InvalidProgramException: JIT Compiler encountered an internal limitation.] 
     &lt;xsl:template name=&quot;date:_format-date&quot;&gt;(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, IList`1 year, IList`1 month, IList`1 day, IList`1 hour, IList`1 minute, IList`1 second, IList`1 timezone, IList`1 pattern) +0 
     &lt;xsl:template name=&quot;date:format-date&quot;&gt;(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator date-time, XPathNavigator pattern) +5170 
     &lt;xsl:template match=&quot;DateTime&quot; name=&quot;dateTime&quot;&gt;(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, IList`1 dt, XPathNavigator fmt) +12397 
     &lt;xsl:template match=&quot;/&quot;&gt;(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +46057 
     Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) +91 
     Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) +28 
     System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) +88 
     System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) +193 
     System.Xml.Xsl.XmlILCommand.Execute(XmlReader contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) +28 
     System.Xml.Xsl.XslCompiledTransform.Transform(String inputUri, XmlWriter results) +81 
     _Default.Button1_Click(Object sender, EventArgs e) in c:\shahid\ccr_test\test1\Default.aspx.cs:35 
     System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 
     System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 
     System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
     System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
     System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 
  </code></pre>