I have a project that I am developing that uses a third party COM library as a reference and I would like to build this project on a Visual Studio Team Services build client. My first idea is to create a MSBuild task that checks to see if the COM library is installed on the local computer and if it is not, go ahead and install it, but this seems like a really messy way to do this. I have searched around but it seems as though all the answers date back years and I can't seem to make the few I have found work in a VS 2013 project. How have other people solved this problem? Is there a cleaner way?
For reference I have also tried this solution, which looks really clean, to no avail.
I would go one of these routes:
tlbimp
, add it to your project and reference it directly:
tlbimp.exe <your_dll>
to generate the interop dll. You can specify the name with /out
option.Add reference > Browse
and click Browse...
to add the dllOLE/COM Object viewer
) or extract it from the dll resources, Add reference > COM
and click Browse...
to add the tlb reference to projectregtlb
, regtlib
or similar tool, as a prebuild step, which should be easier than installing the server (though if it is just a dll, you could use regsvr32
to register it instead of full install). However, this is still more complex than the approach with interop dll