2
votes

Problem:

I’m changing an application (Project A) we developed to use the ClickOnce deployment method. I have a VB DLL project that uses Redemption. This has been running on the client site for 3+ years. We are currently using Install Shield as the installer. Redemption works fine when installed via this method. We are using VS2013 and the application uses .NET 3.5.

After installing the application from a ClickOnce build the application runs but it errors when it tries to use Redemption:

Unable to cast COM object of type 'System.__ComObject' to interface type 'Redemption.IRDOItems'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{F8408EB8-6B65-4704-810C-29795E67C0DD}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

I have another application (Project B) that’s deployed using ClickOnce which also uses Redemption and it works fine. In this project the difference with Redemption is that it is referenced and used in the main project, not a DLL project within the solution. In this project Redemption is listed under Application Files. This application uses .NET 4.0.

To get Project A to work I copied the setting employed in Project B.

In Project B Redemption was marked as:

  • Isolated = True
  • Embed Interop Types = True

In Project A Redemption was marked as:

  • Isolated = True
  • Copy Local = True

Embed Interop Types doesn’t exist because it’s .NET 3.5

The Redemption.DLL isn’t listed in the Application Files in Project A, however if I look at the published files it is included and it’s also deployed on the client machine.

The Native manifest for the VB DLL has all the interface entries as they are in Project B’s manifest.

I found several suggestions after a bing/google search but I couldn’t find someone who had the exact same issue with a COM file. This is what I’ve tried but failed with:

Add the Redemption file to the main project (not referenced to it) and set the Build Action = Content and Copy to Output Directory = Copy Always.

  • This gave me an error when publishing, stating that the manifest for Redemption has already been done (i.e. The native manifest for the VB DLL).
  • Changing the Redemption reference in VB DLL so it wasn’t isolated allowed the build to work but still received the original error.
  • Different combinations of the Build Action and Isolation on Redemption in the VB DLL yielded the same results.

Add the Redemption file to the main project but this time referencing it. Set isolated = true in the main project and set to false in the VB DLL. Also tried various combinations of isolated and copy local in the main project and VB DLL.

Edit the main project file and add an Item Group to deploy manifest as described here:

I changed Project A to use .NET 4.0 so I could have the exact same settings on Redemption as per Project B.

All with same net result.

Summary:

The Redemption.DLL seems to be deployed but not registering in a way for the VB DLL to see it. Any suggestions would be most welcome.

1

1 Answers

1
votes

To get this working I ended creating Redemption as prerequisite.

I created setup project to install Redemption. To make the bootstrapper so it could be used as a prequisite I followed the instructions here https://msdn.microsoft.com/en-us/library/h4k032e1.aspx