locked
Report Builder 3.0 custom assmebly Getting Error RRS feed

  • Question

  • Hi, I have created a very simple class library, test it and it works.  I have also created a very simple report and added the the reference to the assemblies.  Have copied the .dll file to the privateassemblies directories too.  But each time I run the report I get the same old error

    "Error while loading code module: ‘AgeLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'AgeLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

    Is there a step by step process that I can follow to make sure i have not missed anything?

    thanks

    Friday, June 15, 2012 10:52 PM

Answers

All replies

  • Hi There

    Please have a look on these links they might help you

    http://blog.infotoad.com/post/2009/06/24/Reference-custom-assemblies-in-SQL-Server-Reporting-Services-2008.aspx

    http://www.devx.com/codemag/Article/33656/1954

    http://www.sql-server-performance.com/2011/custom-code-ssrs-reporting-services-2008-r2/2/

    http://msdn.microsoft.com/en-us/library/ms159238.aspx

     

    Many Thanks

    Syed Qazafi Anjum

    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful

    • Marked as answer by rv7a99cv Tuesday, June 19, 2012 5:41 PM
    Saturday, June 16, 2012 2:26 AM
  • After going through all and see that I have done all of the steps correctly noticed the problem was with the connection of report builder 3.0.  When you start report builder as the default connects to the report server in my case production but I had my copies of dll files into the test environment.  Also when I just want to use the report builder to test and not the report server, had to make sure at all the time the report builder was disconected from the report server.

    thanks again for your help.

    Tuesday, June 19, 2012 5:41 PM
  • HI all,

    I have exactly the same problem as rv7a99cv, but can't seem to find the solution he did.  I have looked in many places by this point and don't seem to be able to find my answer.  My error message looks as follows:

    Error while loading code module: ‘MyStringBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'MyStringBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    The process I have taken is as follows.  I created a class in Visual Studio using C# with namespace MyStringBuilder, classname MyStringBuilder, and method Testing().  I compiled this class, and I took the MyStringBuilder.dll file and, since I'm using VS2012, I placed it in both:

    C:\Program Files\Microsoft SQL Server\MSRS11.SQLEXPRESS\Reporting Services\ReportServer\bin, and

    C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies

    Though I haven't seen others reference this, my original instructions included the copying and updating of the accompanying rssrvpolicy.config file.  I placed the following code in each:

    For the ReportServer\bin file (placed rssrvpolicy.config file in ReportServer folder):

    [code]
                  <CodeGroup class="UnionCodeGroup"
                       version="1"
                       PermissionSetName="Execution"
                       Name="MyNewCodeGroup"
                       Description="A special code group for my custom assembly.">
                    <IMembershipCondition class="UrlMembershipCondition"
                       version="1"
                       Url="C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\MyStringBuilder.dll"/>
                  </CodeGroup>

    [/code]


    For the PrivateAssemblies file (placed in the same folder):

    [code]
                  <CodeGroup class="UnionCodeGroup"
                       version="1"
                       PermissionSetName="Execution"
                       Name="MyNewCodeGroup"
                       Description="A special code group for my custom assembly.">
                    <IMembershipCondition class="UrlMembershipCondition"
                       version="1"
                       Url="C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\MyStringBuilder.dll"/>
                  </CodeGroup>

    [/code]

    I then went to Report Builder 3.0, opened my rdl file, right-clicked on the report background (blue area) and chose Report Properties > References.  There, I clicked Add, browsed to C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies, and double-clicked the MyStringBuilder.dll file.  I clicked ok, created a textbox in my report, and referenced my assembly method as MyStringBuilder.MyStringBuilder.MyMethod(), passing it some dummy parameters.  I then hit run, and got the above error message.

    I also went to Reporting Services (after restarting it, having put the new dll in place) and just tried uploading my saved rdl file (which has the reference to the assembly method) and go the following error:

    The Value expression for the textrun ‘Textbox3.Paragraphs[0].TextRuns[0]’ contains an error: [BC30451] Name 'MyStringBuilder' is not declared. (rsCompilerErrorInExpression)

    Everything I did seems to go along with what I've read.  Is there something obvious that I am doing wrong here?  Far as I can see, the MyStringBuilder namespace and class should be defined in both of these cases.

    Thanks for any help...

    Bruce

    Thursday, September 27, 2012 8:33 PM
  • Ok, so I continued playing around, and found that if I put the dll into the C:\Program Files (x86)\Microsoft SQL Server\Report Builder 3.0 folder it works.  I'm happy with that as a solution for testing.  It also turns out that if we install the dll into the GAC, since the machine this application will run on will be dedicated, then RS will have access to it from there.

    Bruce

    Thursday, September 27, 2012 8:59 PM