1

I have a .net assembly which has the com classes. I want to register this assembly so that my c++ application can call the methods exposed in .net assembly.

I can register assembly using regasm tool. But I don't want run regasm tool on my client machine.

So the requirement here is to register .net assembly at run-time from c++ application. Also I don't want installer to register assembly.

Can this be possible in C++. I come across manage code which does the similar thing. I also tried RegisterTypeLib api to register the assembly but it does not worked.

  • As far as I know, the only way how to register COM-Assembly is using `regasm`. It should be possible writing the code that `regasm` uses in your application. Unfortunately I can not help with that *(too much work that can be simply avoided using existing solution)*. But when you want to register an assembly you need to have administrator rights. Although there is *(perhaps)* another solution. I saw that there is a Total Commander plug-in, that can use .NET assemblies. Unfortunately I do not know how it works. I did not study it. – Julo Mar 26 '18 at 09:31
  • is this a "registration-free COM interop" thing? https://learn.microsoft.com/en-us/dotnet/framework/interop/registration-free-com-interop https://msdn.microsoft.com/en-us/library/ms973913.aspx – Marc Gravell Mar 26 '18 at 09:35
  • No it is not "registration free COM interop" – pritesh dahivelkar Mar 26 '18 at 09:58
  • 1
    There's no magic in regasm. There is some sample code here that does that : https://stackoverflow.com/questions/35782404/registering-a-com-without-admin-rights it's in C#, but easy to port to C++ – Simon Mourier Mar 26 '18 at 10:04
  • Here is a sample code which register assembly but it is in c#. https://stackoverflow.com/questions/2378730/register-a-c-vb-net-com-dll-programmatically I was looking for similar code. Wondering if there are win32 api to register assembly. I also tried win32 api RegisterTypeLib but it does not work. – pritesh dahivelkar Mar 26 '18 at 13:38

0 Answers0