2

We recently upgraded our report server to 2016 and everything worked great except for the reports that contain barcodes. I tried going back through the same article I used the first time we started using barcodes but so far I have not had any luck. I am getting this error:

"Failed to load expression host assembly. Details: Could not load file or assembly 'BarcodeLib, Version=1.0.0.18, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418) (rsErrorLoadingExprHostAssembly)"

Has anyone else encountered this problem? What am I missing?

Stinkpile
  • 21
  • 3
  • You have to ensure that the assembly referenced by your report is located in a directory on the reporting server where SSRS can find it. – Ross Bush May 02 '17 at 12:42
  • @RossBush As far as I can tell, I am referencing the assembly, but it is entirely possible that I am putting it in the wrong place. I added the library to these locations: C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\bin C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies Do you know if there is a location that I missed? – Stinkpile May 05 '17 at 14:38
  • @Stinkpile did you manage to resolve this? I've recently inherited the same problem with trying to get BarcodeLib 1.0.0.22 working in VS2017, hoping you managed to resolve whatever it is. – Lefty Jul 14 '17 at 15:56

3 Answers3

0

If the assembly is accessible to SSRS then it must be expecting a different version of your assembly. You can either ensure your version matches the definition in your reference or remove the version altogether to see if that is the problem.

Change your report reference to (No version) --> BarcodeLib, Culture=neutral
Ross Bush
  • 14,648
  • 2
  • 32
  • 55
  • I removed the reference to the version in the report, but unfortunately I am getting the same error when I attempt to run it. – Stinkpile May 05 '17 at 15:14
0

I fixed that problem using this in the SSRS server side:

  • Copy barcodelib.lib in the SSRS server portal on: C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\Portal

  • Register the library with: (C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64)\gacutil -i C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\Portal\barcodelib.dll

The barcodelib.dll should be the same version of the SSRS error.

0

You need to place the dll for BarcodeLib to the following paths on the server:

Reporting Services 2016

%ProgramFiles%\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\bin

Reporting Services 2017 and later

%ProgramFiles%\Microsoft SQL Server Reporting Services\SSRS\ReportServer\bin

Found the solution in the following article: Deploying a Custom Assembly.

Artur
  • 334
  • 5
  • 15