Report Preview and External Assembly

3 posts, 0 answers
  1. Mark
    Mark avatar
    8 posts
    Member since:
    Jun 2011

    Posted 08 Nov 2018 Link to this post

    I have been unable to get a Report Preview to work in Visual Studio (I am using 2017). The specific problem is that when I run the preview, I get the error "Could not load file or assembly '(my assembly), Version=(the version), Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

    We require this custom assembly for various common lookups and data access, including accessing an S3  bucket using AWSSDK.S3.

    Anyway, I have searched the web and these forums, and have tried dozens of solutions, none of which work. To prevent needless repletion of solutions that don't work, some solutions I have tried are on these links:

    https://www.telerik.com/support/kb/reporting/details/how-to-use-external-assemblies-with-custom-user-functions-in-the-report-designer

    https://www.telerik.com/forums/report-preview-fails-due-to-dependency

    https://www.telerik.com/forums/designer-use-when-code-references-external-dlls

    There are others, too but all basically the same thing. Either the solution tells me to add the runtime assemblyBinding and AssemblyReferences to the app.config, or to put the assemblies in the folder where the Report Designer executable is (i.e., "C:\Program Files (x86)\Progress\Telerik Reporting R2 2018\Report Designer"). That later is pretty dumb, as we would need to copy it there each time we rebuild the assembly, and I hope its not the actually solution... Regardless, I tried both of these solutions, and both together at the same time, and they simply do not work. I continue to get the error.

    Most of the posts about this are from years ago, however, so perhaps things have simply changed, and those solutions do not work any more. I am sure we're not the only people trying to use telerik reports that call out to custom libraries.

    So, the question is, how do we get the Report Preview to work in VS2017 when the report needs to access functions in an external, custom assembly?

    Thanks in advance!

  2. Mark
    Mark avatar
    8 posts
    Member since:
    Jun 2011

    Posted 08 Nov 2018 Link to this post

    Since I can't edit my post, apparently, I should add that the Reports run fine when executed in the application, which is a web site, and shown in the web viewer. So everything should work. I just wanted to mention that point, in case the question was asked. Thanks.
  3. Todor
    Admin
    Todor avatar
    520 posts

    Posted 13 Nov 2018 Link to this post

    Hello Mark,

    We have answered your questions in the support ticket you opened on the same issue. For the benefit of our community I will summarize the response here :

    The Extending Expressions help article is applicable to both Visual Studio Report Designer and the running application with the report viewer.

    However, in the context of the Visual Studio Report Designer, the application which has to be extended is Visual Studio itself. The configuration file of Visual Studio is devenv.exe.config and is located in the Visual Studio installation folder on your machine. Modify it by adding the needed configuration elements and also add the assemblies to the corresponding location.

    In the context of a web application containing a report viewer, the configuration file is the web.config.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top