cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dschroeder
Level 3

Registering .NET DLLs

Hello all,

I've been having a problem for the past few days trying to register a .NET DLL for COM interop using InstallShield 2008.

InstallShield offers the option to go into the properties of the file and the .tlb file and click "self register", I've done this. However it still does not work!

A colleague created a VisualStudio installer and it works for registering the DLL. Also, the DLL seems to work on any machine that the DLL is built on (i.e. take the VS solution to another machine, build it and it will register correctly).

At first we assumed it was a dependency issue dealing with Visual Studio being on the machine the DLL runs on, but since my colleage created the installer from Visual Studio, we've tried installing on machines without VS, and had success -- but still not with the InstallShield created setup.exe.

Has anyone run across these issues in the past? Any suggestions?

DS
Labels (1)
0 Kudos
(10) Replies
Egghead
Level 3

dschroeder wrote:
Hello all,

I've been having a problem for the past few days trying to register a .NET DLL for COM interop using InstallShield 2008.

InstallShield offers the option to go into the properties of the file and the .tlb file and click "self register", I've done this. However it still does not work!

A colleague created a VisualStudio installer and it works for registering the DLL. Also, the DLL seems to work on any machine that the DLL is built on (i.e. take the VS solution to another machine, build it and it will register correctly).

At first we assumed it was a dependency issue dealing with Visual Studio being on the machine the DLL runs on, but since my colleage created the installer from Visual Studio, we've tried installing on machines without VS, and had success -- but still not with the InstallShield created setup.exe.

Has anyone run across these issues in the past? Any suggestions?

DS

I remember the progress of register .NET active X or COM DLL is not the same as normal activeX/COM. You better read on how the normal .NET com objects register 😛
0 Kudos
Dan_Galender
Level 10

Is this a Basic MSI project?

If so, have you looked at the component .NET COM Interop property?
0 Kudos
dschroeder
Level 3

This is indeed a basic MSI project.

The property that you're referring to... are you meaning the ".NET framework locations" entry area under (Tools -> Options -> .NET)? If so, the entries appear to be correct:

RegAsm:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe

InstallUtilLib.dll:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtilLib.dll


Every machine I've tried my install on, it has had .NET v2.0.50727, and still does not register. The only machines it registers correctly on are those where the DLL is built (compiled), or the Visual Studio installer my colleague built is used. Also, please know that when she built that project, all she had to do was go to the properties and "enable for com interop" option.... she did nothing fancy.

I've been pulling my hair out over this for two days now, haha!

---EDIT---
It may also be useful to know that In Tools->Options->Preferences I have the following settings:
---Self Registration
----- ISSelfreg (have tried the selfreg option though)
----- Com extraction will occur during the build
0 Kudos
dschroeder
Level 3

Egghead wrote:
I remember the progress of register .NET active X or COM DLL is not the same as normal activeX/COM. You better read on how the normal .NET com objects register 😛


You are right Egghead. .NET DLLs register using a different register service (RegAsm.exe from the .net framework) instead of regsvr32.exe . I've found that you're also supposed to include the .tlb file, and mark it to self register as well.
0 Kudos
Dan_Galender
Level 10

dschroeder wrote:
The property that you're referring to... are you meaning the ".NET framework locations" entry area under (Tools -> Options -> .NET)? ...


No, I'm referring to the Component property setting.
0 Kudos
TheTraveler
Level 8

If all else fails, you always run the regasm.exe in the .Net Framework with the necessary parameters to register your DLL. It may bring up a DOS window, but it works.
0 Kudos
MGarrett
Level 6

Try using Dependency Walker www.dependencywalker.com to profile the registration process. This should let you know if it is a dependency issue.
0 Kudos
dschroeder
Level 3

DanGalender wrote:
No, I'm referring to the Component property setting.



Dan... You may be my new superhero.

I never even knew that pane of information was there - It wasn't visible until I started doing some poking around.

You're right. The "Com Interop" value was set to "No" even though I had right clicked the file and said to self-register.

The registration worked!

I've only tried it on one machine so far (I need to build another machine to test it on) so I can't be 100% sure it's not a dependency issue with something risidual on that machine, but you've gotten me further than I've been in days --- thank you so much.

DS
0 Kudos
dschroeder
Level 3

MGarrett wrote:
Try using Dependency Walker www.dependencywalker.com to profile the registration process. This should let you know if it is a dependency issue.


I had tried Dependency Walker previously. It didn't have any errors.

It's actually a really simple DLL (just a connection string to a database with some return values)...

Thanks for trying though! Dan probably got my fix action in his post.
0 Kudos
Dan_Galender
Level 10

dschroeder wrote:
Dan... You may be my new superhero.


Can I have a cape, please?

I shovel really well.
0 Kudos