Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while previewing SSRS Reports in VS2017 with Custom Assemblies

We're trying to migrate our old Reporting Services solution from Visual Studio 2008 with Business Intelligenge Studio, to Visual Studio 2017 with SQL Server Data Tools. The reports in the project are referencing a custom assembly for localization of the reports. And that custom assembly project is part of the solution.

As with VS2008, for the reports project to be able to be built, the custom assembly needs to be built and placed in the Private Assemblies folder for VS, no worries there.

But when I try to preview the reports in VS, it still gives this error

Error while loding code modue: MyCompany.MyDllName, Version=1.2.3.4. Details: Could not load file or assembly MyCompany.MyDllName, Version=1.2.3.4, or one of it's depencies. The system cannot find the file specified.

I have checked that the file does exist in the Private Assemblies folder, and that the version number matches the one referenced in the reports.

Where do I need to place the file for the preview view to be able to find it? And how can it be different from where I need to place them for the reports to build?

like image 223
Ericson Avatar asked Feb 04 '23 10:02

Ericson


2 Answers

After struggling with a similar issue (but not for custom assemblies) for days, this post helped solve the problem. In my case I was getting the error

Could not load file or assembly 'Microsoft.ReportingServices.ReportDesign.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken-89845dcd8080cc91'

when trying to run the ReportViewer from the IDE, after installing Visual Studio 2017 (15.6.6) and SQL Server Data Tools - Visual Studio 2017 (version 14.0.16162.0 in control panel, version 15.1.61801.210 in the VS 2017 "Help/About..." - at this point I've given up on understanding Microsoft versioning).

Copying the DLL from:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Reporting Services

to:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS (different target path than noted in previous posts)

resolved the problem.

like image 134
Steve Avatar answered Feb 07 '23 00:02

Steve


Error in Preview of rdl reports in vs 2017:

If your VS version is Enterprise then copy your assembly to this path:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Micros‌​oft\SSDTRS

And if the version is Professional use this path instead:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\SSDTRS


Error in Building reports project in vs 2017:

If your VS version is Enterprise then copy your assembly to this path:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies

And if the version is Professional use this path instead:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies

like image 32
Merta Avatar answered Feb 07 '23 01:02

Merta