Re: Can't register an assembly for COM interop
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Tue, 6 Dec 2005 13:51:59 +0100
"Joseph Rea, Accord Software"
<JosephReaAccordSoftware@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:83A3CA3C-C941-4907-8167-37251F1975D9@xxxxxxxxxxxxxxxx
>I have created a C# class library project in VS.NET 2003 that handles
> encryption. I have various methods that make calls to different algorithms
> in
> the System.Security.Cryptography namespace. I'm then 'registering my
> project
> for COM interop' so that I can call in from another application via COM.
> On
> my development machine (W2K), all I have to do is compile the class
> library
> with the 'register for COM interop' option on, and then i can access my
> dll
> via COM. However, if I do not use Visual Studio to register my assembly
> and
> use regasm instead, I cannot access the COM objects. Regasm says it
> executes
> successfully and I can see entries in the registry for my classes, but
> still,
> they are not available. I've tried doing the actual registration with
> regasm,
> as well as generating a .reg file and doing it that way, and also using
> the
> /tlb switch (each in different tests), but to no avail. I cannot see what
> I
> am missing or doing wrong when trying to register my assembly. Any
> suggestions/information would be greatly appreciated.
>
> Thanks very much in advance.
If you did not run regasm with the /codebase option, your assembly must
reside in the clients folder or must be installed in the GAC.
So your options are:
1. install the DLL in the same folder as the COM client
2. run Regasm /codebase
3. install the DLL in the GAC using gacutil, or (preferably) through a
deployment project (msi file)
Note that 3 requires your assembly to be strong named, while 2 advises your
assembly to be sn'd.
Willy.
.
- Prev by Date: Re: How to marshal a .NET string[] return value from a C# COM Server
- Next by Date: Could not load File or Assembly "Microsoft.office.Interop.Excel"
- Previous by thread: RE: AXIMP: reference rcw generates error
- Next by thread: Could not load File or Assembly "Microsoft.office.Interop.Excel"
- Index(es):
Relevant Pages
|