Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I control version number assigned to interop assembly?

I have a C# program that uses a native C++ COM object. Visual Studio generates an interop assembly with wrappers for the types in the COM object. Each time I recompile the C# program interop assembly has version 1.0.0.0.

This is bad for the installer - sometimes we extend the COM object interfaces (add new methods at the end of some interface) so the interop assembly has to be changed. when the installer tries to update an existing installation it thinks that the interop assembly hasn't changed (since it still has version 1.0.0.0) and skips updating it and the program doesn't work.

How can I control the version number assigned to the interop assembly?

like image 617
sharptooth Avatar asked Nov 05 '22 05:11

sharptooth


1 Answers

It's been a little while so I might be remembering incorrectly how this works but I think that you might be able to do what you want if you use Tlbimp rather than having VS create the wrappers.

Possibly you could do it using the asmversion parameter and otherwise it might be possible if you give it a strong name using the keyfile parameter.

like image 107
Hans Olsson Avatar answered Nov 11 '22 03:11

Hans Olsson