We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Unable to register assembly for COM interop

I have an assembly that was built in Visual Studio. It is set as COM visible and in Visual Studio the Register for COM interop flag is ticked. I have used Visual Studio's own setup and deploy projects in the past to register it and it creates a tlb file for me to deploy.

When I attempt to take the required steps in AI in order to get the same output I don't appear to be able to do so.

I have added the assembly to my output folder. I have gone to the properties and set the registration to Auto Register file and have selected the Register .Net assembly for COM interoperability. Synchronization is set to Enabled. When I click OK to save the properties I get an error message saying:

The selected file could not be registered.

If I set the synchronization to buildtime it saves OK. However I thought that by setting it to enabled it would create my tlb file that I could then add under the COM tab. Ultimately I need the tlb file in my main file location next to my assembly.

Thanks

David
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Unable to register assembly for COM interop

As an update I managed to get this to work using a assembly that was built in the same way so I will have to go back and have another look at my original assembly and see if there is anything going on with that one... If you have any thoughts as to what may be happening then I would be happy to hear them. If nothing else is it possible to get some information as to why I am unable to save the properties while setting it to register for COM interop?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Unable to register assembly for COM interop

Hello,

Unfortunately, we don't have support to extract a TLB from COM assembly. In order to achieve what you want you should manually extract (outside of Advanced Installer) the TLB file from your COM assembly and, then add it in "Files and Folders" page into desired directory and enable its "Register .NET assembly for COM interoperability" registration option.

Also, we'll try to add this functionality (extract TLB from COM) in a future version of Advanced Installer. Thank you for your suggestion.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Unable to register assembly for COM interop

I worked out what the issue was with my first component. I was getting the error:
The selected file could not be registered.
The reason I got the error is that the process to register the assembly for COM interop uses Regasm. However if Regasm fails for whatever reason you don't get the reason telling you why but rather you get the above error message. In my case I worked out (by doing a direct Regasm on the component). By moving a required dependency assembly to the same directory as my initial component I ran Regasm and it worked. I then tried using the properties, register for COM interop and it worked. I no longer got the same error.

Hope this helps somebody else! It would be good if the actual Regasm error was shown somewhere as it would make it much easier to work out what is required.

David
Last edited by zeiddev on Tue Sep 01, 2020 6:56 pm, edited 1 time in total.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Unable to register assembly for COM interop

Hello David,

Thank you for sharing this with us. I'm sure this will help future users in the same situation.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Unable to register assembly for COM interop

Hello,

This improvement has been added in Advanced Installer 17.3, released on July 29th, 2020.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”