Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Regasm during install

17 views
Skip to first unread message

Ian Turner

unread,
Apr 25, 2002, 7:35:32 PM4/25/02
to
Hi,

I've got a class library (c#) project that I need to register for COM (using
the Register for COM Interop property and a Strong Name Key file). When I
build the project in Visual Studio, it goes through the usual Unregistering
for COM, Registering for COM and everything is fine and dandy.

However, when I create a Setup project and deploy that to another machine,
the CLSID and PROGID registry entries are not created. The dll in question
is being deployed into the Global Assembly Cache. If I manually run RegAsm
from the command line, it adds the CLSID and PROGID (no codebase gets set -
suggesting that it has found the assembly in the GAC).

Within the Setup project, I have set the register property of the primary
output to vsdrpCOM expecting it to register the assembly.

So, does anyone know why this is not registering correctly? Or does the
vsdrpCOM setting not actually do the COM registration after all.

Any help would be much appreciated.

Cheers
Ian


Falk Schneider

unread,
Apr 26, 2002, 10:38:23 AM4/26/02
to
Same thing i figured out when registering a VB.Net library into COM for use
with an VB6 server! - Seems to be a bug!?

Actually I couldn't find a way to deploy a solution to a production machine,
though it works perfectly on the development system!!!

I would very much appreciate any help, too (...perhaps from MS!?)

Thanks Falk

"Ian Turner" <iturn...@hotmail.com> wrote in message
news:#xXCyGL7BHA.2016@tkmsftngp03...

Waldyn

unread,
Apr 26, 2002, 1:00:22 PM4/26/02
to
I have successfully registered a .NET server for COM outside of VS.NET. I
used GacUtil and Regasm. I have also used COMREG (Framework interop
sample), it will do the GAC install as well as the registration.

I have not had much luck with DCOM yet, even using COMREG.

Waldyn Benbenek
"Falk Schneider" <f.sch...@dasgip.de> wrote in message
news:#gj9GAT7BHA.2112@tkmsftngp02...

Ian Turner

unread,
Apr 26, 2002, 8:02:50 PM4/26/02
to
I've found a way of doing this that works fine for my requirements.

1. Add a new class to the Primary Ouput project, derived from
System.Configuration.Install.Installer and mark the class with the
System.ComponentModel.RunInstaller attribute
2. Override the Install and Uninstall methods and use the
System.Runtime.InteropServices.RegistrationServices class to register and
unregister the assembly.
3. Add Custom Actions to the Install and Uninstall phases of the setup
project. Make sure both actions have the InstallerClass property set to
true.

When the setup is executed, the Custom Actions will invoke the Installer
derived class that you have added, and will do the registration /
unregistration for you.

This is what my Installer class looks like in C#:

using System;
using System.Configuration.Install;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace TestProject
{
[RunInstaller(true)]
public class ComInstaller : Installer
{
public override void Install(System.Collections.IDictionary
stateSaver)
{
base.Install(stateSaver);

RegistrationServices regsrv = new RegistrationServices();
if (!regsrv.RegisterAssembly(this.GetType().Assembly,
AssemblyRegistrationFlags.SetCodeBase))
{
throw new InstallException("Failed To Register for COM");
}
}

public override void Uninstall(System.Collections.IDictionary
savedState)
{
base.Uninstall(savedState);

RegistrationServices regsrv = new RegistrationServices();
if (!regsrv.UnregisterAssembly(this.GetType().Assembly))
{
throw new InstallException("Failed To Unregister for COM");
}
}
}
}

Cheers
Ian

"Falk Schneider" <f.sch...@dasgip.de> wrote in message
news:#gj9GAT7BHA.2112@tkmsftngp02...

0 new messages