Ben Walker
  • Blog
  • Blog

Error while loading code module: ‘Microsoft.Crm.Reporting.RdlHelper’

27/4/2017

1 Comment

 
When trying to compile a FetchXML-based report in Visual Studio 2015 which had been developed in an earlier version of Visual Studio, we were getting the following error:
Building the report, ReportName.rdl, for SQL Server 2008 R2, 2012 or 2014 Reporting Services.
[rsErrorLoadingCodeModule] Error while loading code module: ‘Microsoft.Crm.Reporting.RdlHelper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.
Details: Could not load file or assembly ‘Microsoft.Crm.Reporting.RdlHelper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
[rsCompilerErrorInExpression] The Language expression for the textrun ‘Table0_Details0.Paragraphs[0].TextRuns[0]’ contains an error: [BC30456] ‘Crm’ is not a member of ‘Microsoft’.

We had already installed the CRM Report Authoring Extension for CRM 2015, but this helper dll was not being picked up by Visual Studio.
We were able to locate the dll on the SSRS Server of our CRM Development environment – in our case it was located here:
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin
but it may be elsewhere for different versions of SQL or CRM.
We copied the dll to the developer PC’s and then registered it in the GAC (Global Assembly Cache) on these machines. This is done by running the gacutil.exe utility. In some cases, this might be available from a normal command prompt, but we found we had to access it by running the Visual Studio 2015 ‘Developer Command Prompt for VS2015’.
On Windows 10, you can access this from the start menu like this – You need to run the programme as an Administrator, so find the programme and then Right-Click to Run As Administrator:
Picture
(You will have to get to this in a slightly different way if you are using Windows 7, but it is still accessible from the Start button). With the new window open, navigate to the folder where the dll is and run the command gacutil -i Microsoft.Crm.Reporting.RdlHelper.dll
Picture
If you are compiling a report in Visual Studio and it is giving the error above, you might need to point the report to this version of the RdlHelper.dll
Open the report in Visual Studio. select Report -> Report Properties from the menu. (NB This options is only available if the report is open and you have selected an element on the report designer/previewer.)
Picture
In the Report Properties dialogue box, select ‘References’.
Picture
Even if the RdlHelper is listed, it may be that this is the wrong version. Click on ‘Add’ and then browse to the newly registered dll in the GAC. This will be at a location like this:
C:\Windows\assembly\GAC_MSIL\Microsoft.Crm.Reporting.RdlHelper\7.0.0.0__31bf3856ad364e35\Microsoft.Crm.Reporting.RdlHelper.dll although the exact location will depend on which version of the helper you have installed.
Remove any pre-existing references (which are most likely to a different version of the dll).

You can download a copy of the dll from the link below, although I cannot guarantee that this will be the version that you need to work in your environment.
microsoft.crm.reporting.rdlhelper.dll.zip
File Size: 18 kb
File Type: zip
Download File

1 Comment
Sergii link
19/1/2022 03:11:53 pm

To run the subscriptions on Reports, you need to place the dll also in C:\Program Files\Microsoft Dynamics CRM Reporting Extensions\bin

Reply



Leave a Reply.

    Archives

    July 2021
    June 2021
    May 2020
    March 2020
    December 2019
    October 2019
    June 2018
    February 2018
    October 2017
    September 2017
    August 2017
    May 2017
    April 2017

    Categories

    All
    Dynamics 365
    Dynamics CRM
    FakeXrmEasy
    LINQPad
    Testing

    RSS Feed

    Author

    Some stuff about me!

Proudly powered by Weebly