"Exception has been thrown by the target of an invocation" Error

I am using Aspose Barcode for SSRS. Everything has been working fine for some time until I logged on today to find that any Visual Studio reports using the barcode extension now displayed an error stating the extension wasn’t installed. After checking the .config files, it appears that they had somehow reverted back to default and the code entries were gone. I have re-entered the code entries for RSReportDesigner.config and RSPreviewPolicy.Config and my barcode extension now gives the error “Exception has been thrown by the target of an invocation”. Please advise. Thanks.

@Steve_Flynn,

Could you please confirm that SSRS is not updated at your end or Visual Studio .NET is not upgraded after which you started facing issue? You may try to manually install Aspose.BarCode for RS or even a fresh installation using MSI installer or manual installation would help you.

You may also try configuring the Visual Studio as follows:

Once we get feedback, we will analyze this issue more and provide our feedback.

If your VS updated VSIX to 2.6.7 version you need Aspose.BarCode for Reporting Services 20.6
MSRP_2.6.7.png (31.8 KB)

However there is an unfixable MS bug with preview mode in VS 2017/2019. To avoid the bug you can take solution from this topic and forbid VSIX component to be updated.

Information about VSIX you can find here

Hi Alexander

I can confirm that my current VS version is 2.6.7. To upgrade to 20.6 do I just need to replace the DLLs? Please confirm. Thanks.

I replaced the VS dll and I the control now appears to display a barcode preview. However, when I try to preview or adjust properties, I get the following error. Please advise. Thanks.

Capture.JPG (52.6 KB)

Did you replaced dll with config tool or manually.
If you replaced manually, from which folder did you get dll.
And what is your version of Visual Studio.
Also what version of “Microsoft.ReportingServices.Interfaces.dll” lies in the VS SSRS folder.

This error could happen if you put VS SSRS 14 library to VS SSRS tools which supports only 15 version (VSIS 2.6.7).

Hi Alexander

I replaced the dll manually

I got the dll from VS2017SSRS14

I’m using VS2017

The file I placed in C:\Program Files (x86)\Microsoft Visual Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSRS was the dll I got from folder VS2017SSRS14

I’ve since replaced this with the dll from folder VS2017SSRS15 and the control now seems to work. However, the preview now fails, although the report works once deployed and run from the server. I previously had an issue with previewing reports, but this just caused the barcode to be invisible within the VS preview. Now, the report fails completely when previewing (see attached error)

Capture.JPG (8.3 KB)

VS 2017 from SSDT 15.8.1 uses SSRS 15.x, so you need VS2017SSRS15 if you use VSIX 2.6.7

In previous version of Aspose.BarCode for Reporting Services VS2017 folder has SSRS 14.x, VS2019 folder has SSRS 15.x.

VS2017SSRS14 for Download SQL Server Data Tools (SSDT) for Visual Studio 15.8.0 and lower.

Hi Alexander

As per my previous reply, I have already swapped the dll to SSRS15 version. The control now works but previewing the report causes it to crash completely. See attached error. Please advise.
Capture.JPG (8.3 KB)

This is well known bug, you can read about it on MRSP board

Microsoft developers have broken preview functionality in VS from VSIX 2.6.2. There three solutuions:

  1. You can upload your project to SSRS server to preview
  2. You can use custom drawing functions ReportingArticles.zip (235.0 KB). Articles on our documentation services are disappeared, so you can read from doc. Articles will be updated on our services.
  3. Most right variant. Use VSIX 2.6.1 with 20.4 which works well.