“System.InvalidProgramException: Common Language Runtime detected an invalid program” while rendering Data View Web Parts


On a busy Tuesday, users of our SharePoint 2010 farm started receiving the following error on a web part page.

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

The web part page was Post.aspx page in a Blog site. We’ve modified XSLT of the web part displaying the post (title and body) in order to change the default blog picture (date view calendar) to poster’s profile picture.

The error message from ULS log was,

Error while executing web part: System.InvalidProgramException: Common Language Runtime detected an invalid program.   
at Execute(XmlQueryRuntime )   
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)   
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)   
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results)   
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments, Boolean bDeferExecuteTransform)   
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

It looks like a random issue with SharePoint 2010 List View/Data View web parts whose XSLT has been customized. Restarting IIS on the web front end server resolved the issue. Hope Microsoft’s fixed the issue in SP1.

Advertisements

7 thoughts on ““System.InvalidProgramException: Common Language Runtime detected an invalid program” while rendering Data View Web Parts

  1. I could not find a cause of solution yet. Recently installed SP1 and hoping it’s been taken care of. Will update here if it happens again or if I find a solution.

    • Saji,

      Did you ever find a solution to this problem? We just started seeing this same issue about a month ago. Any help is appreciated.

      Thanks,
      Derek

      • Unfortunately no. We experienced the issue only once which got resolved by restarting IIS. We haven’t seen this issue since then. Now we are upgrading to SP 2013 and hence may not dig into the issue anymore. Anyway, I’ll update if I find a solution on the web.

  2. Hi,

    we just had the same problem . WITH SP1. sorry, seems not to be fixed. We did not find any cause of the behaviour, too.

    Ralph

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s