I am writing an add-in for a software (namely Autodesk Robot).
The software's maintainers have produced a document describing the creation of an add-in, which explains the following steps:
[1. to 6. are about configuring writing and building your project.]
Then
File menu \ Open \ File
-> open created dll file (in our example …\MyAddin\bin\Debug\MyAddin.dll)Add created
tlb
library todll
(right hand mouse click menu), Resource type should be named as TYPELIB:
- Change TYPELIB number onto 1 using Properties (right hand mouse click menu)
- Close Visual Studio and save changes to dll file
- Take \ copy created
dll
file to any computer you want to use, after locating it in target folder please register it this way: Open Command Prompt window as Admin And register it by commands:c:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /tlb /codebase MyAddin.dll
I am trying to automate the process of generating and embedding the .tlb
file. After reading about this quite extensively, I found this question and the link to this blog post which is in the comments of the accepted answer.
I have added an .rc
file to my project, created the .tlb
file, put the two of them in the .\bin\Debug
folder of the project, compiled the .rc
to a .res
and finally pointed the builder to this resource file I just created, as the answer to the question mentioned above suggested.
My .rc
file content is as follows:
1 TYPELIB "RobotOrientAddIn.tlb"
When I build my project, I don't get any error message, but if I open the created dll
file, there is no trace of the "TYPELIB" resource in the file's tree... and I have no idea why!
Reading MS docs didn't help much as I am not very familiar with the .NET
jargon.
I am very confused about this and would appreciate if someone could help. Ultimately, I would like to do all this in post-build events so that there is no manual fiddling after building the project.