Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

COM/Interop - Supporting Multiple Versions

I've written a .NET console app that wraps CuteFTP's Transfer Engine - a COM object (ftpte). The version I wrapped is CuteFTP 7.0. I'd like to also support the 8.0 version, as some of the clients I integrate with have that version.

I have a reference in my Visual Studio project to the CuteFTP COM object... how can I reference the version 8.0 component and still support version 7.0? It seems to me that I'm forced to choose at design time, unless I make a bigger architectural shift.

Ideas?

like image 492
Mike L Avatar asked May 08 '26 17:05

Mike L


2 Answers

Look at my hobby open source project MS Office Wrapper for .NET. There is used a "late-binding" which allows you to use a different version of COM libraries.

like image 92
TcKs Avatar answered May 11 '26 14:05

TcKs


You need to reference the lowest version you need to support, and given that the new version do not change the API, but just add new functionality, you should be OK. But it clearly depends on application developers to not break the API.

That way, you will miss any new functionality added in the newer version, but at least old functionality should work.

like image 37
Sunny Milenov Avatar answered May 11 '26 15:05

Sunny Milenov