What does RegAsm really do? Where are files copied?
Asked Answered
D

1

9

We have a plugin for IE based on spicIE, the purpose is to connect to some external devices.

To connect to those external devices, another company developed their token & DLLs. We need to have some ActiveX's and DLL's to do authentication by token.

The problem is that the plugin we developed for IE, in final part have a install.bat file, that runs a RegAsm and registers the DLL and after that plugin (or its changes) is viewable in IE.

When running the plugin from IE, our code can not find some DLL, required for authentication (name it x.dll). Where is registered DLL copied? Is it really copied? I need to have x.dll in the folder where my plugin's DLL exists.

Doit answered 17/4, 2012 at 8:53 Comment(0)
S
9

In a nutshell, RegAsm registers your .NET assembly to be COM-viewable. From MSDN: Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered.

Without seeing your code in ActiveX, if I understand you correctly, your ActiveX is dependent on some COM DLLs, which is why you are running RegAsm against a .NET DLL.

Run RegDllView to find the details of what is registered and then check if you are indeed instantiating that object which was in fact registered.

Also, if you still have problems, try instantiating the object in VB6/Visual Studio 2010 etc. or equivalent in early binding to see if you have any problems. Examine the error on instantiation.

Stratovision answered 17/4, 2012 at 9:2 Comment(3)
the situation is reverse, we need to instantiate the com/active x components in our managed code, our managed code can not find the com/active x componentsDoit
Ahh ok. If these are classic COM components, then you should just be doing regsvr32 on them. After that, you should be able to add a reference in your VS .NET project, under the COM tab and instantiate. VS does all the hard work for you in the background in terms of type mapping etc.Stratovision
Also just to add to that, there is good information here: #636339 which should help you get started too. Again, try to instantiate it and examine the HRESULT/catch that comes out as you go along.Stratovision

© 2022 - 2024 — McMap. All rights reserved.