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

RegFree COM for ".Net COM object" (COM callable wrapper)

69 views
Skip to first unread message

Kasper G. Christensen

unread,
Mar 17, 2008, 5:15:24 AM3/17/08
to
Hi

I'm trying to make a stepwise partial transition to .Net, by
implementing new functionality in a .Net class library, and making a COM
interface for this library (COM callable wrapper) so that my old legacy
application can call the new functionality (implemented in .Net) by
using COM.

It all works out fine in most scenarios, but having to register my .Net
classes for COM (regasm.exe) on the client, seems a little clumsy, and
may leed to "DLL Hell" in the long run. I then found references to
"RegFree COM" or "Side by Side COM" and thought "this is just what I
need!" (http://www.codeproject.com/kb/vista/regfreecom.aspx)

My problem is, that I don't know how to generate/write a manifest-file
for my .Net/COM library. The abovementioned article describes how to use
VS2005 to make a COM reference and autogenerate the manifest, but that
method apparently won't work when the COM component really is a .Net
class, since the component won't show up in the "Add References" dialog
on the "COM" tab. And I've also read (in a comment to the abovementioned
article) that VS won't allow a COM-reference to a component that are
really a .Net class (sensible enough). But how can I then get a
manifest-file for referencing my COM component (wrapped .Net)?

TIA

Kasper G. Christensen

Willy Denoyette [MVP]

unread,
Mar 17, 2008, 7:16:21 AM3/17/08
to
"Kasper G. Christensen" <no...@nowhere.com> wrote in message
news:uvM3v9Ai...@TK2MSFTNGP03.phx.gbl...


Check this:
http://msdn2.microsoft.com/en-us/library/eew13bza(VS.80).aspx

Willy.

Kasper G. Christensen

unread,
Apr 1, 2008, 5:06:15 AM4/1/08
to
> Check this:
> http://msdn2.microsoft.com/en-us/library/eew13bza(VS.80).aspx

Thank you, that was just the kind of information I needed to get
started. I have discovered that the "component manifest" for the .Net
based COM assembly, can be generated by mt.exe, so that should make it
all very easy, even with a lot of classes in the .Net/COM library.

Unfortunately it doesn't work!!

I have tried a lot of small changes to the manifests, and when something
is wrong, i get "appliation configuration error" or something like that
on startup, and am able to find an explanation in the event-log. But now
I have a setup, where I get no errors, but my client just can't find the
"side by side" COM component. How on earth do I debug this situation?

All works well with component registrered. When I unregister, it doesn't
work anymore (no ole automation interface). If I change the manifest for
the application or in the COM component, I get error-messages, so I take
it that the manifest are i fact read. Unfortunately, my application
can't instantiate the component. How to debug?

TIA

/Kasper

Willy Denoyette [MVP]

unread,
Apr 2, 2008, 7:50:24 AM4/2/08
to
"Kasper G. Christensen" <no...@nowhere.com> wrote in message
news:%232s1ie9...@TK2MSFTNGP02.phx.gbl...

Not sure what errors you are getting, but be aware that the client (COM) and
the managed assembly must reside in the same folder for this to work!

Willy.

Kasper G. Christensen

unread,
Apr 3, 2008, 4:56:05 AM4/3/08
to
> Not sure what errors you are getting,

My COM Client is written in Clarion (http://www.softvelocity.com/) and
the only error I get is "No OLE Automation Interface", which is the
normal error-message when the requested COM component isn't registered.

> but be aware that the client (COM)
> and the managed assembly must reside in the same folder for this to work!

Both client and COM assembly is in the same folder. But thank you for
the suggestion.

Best regards

Kasper

Willy Denoyette [MVP]

unread,
Apr 7, 2008, 12:00:26 PM4/7/08
to
"Kasper G. Christensen" <no...@nowhere.com> wrote in message
news:OSUwOiWl...@TK2MSFTNGP06.phx.gbl...

>> Not sure what errors you are getting,
>
> My COM Client is written in Clarion (http://www.softvelocity.com/) and the
> only error I get is "No OLE Automation Interface", which is the normal
> error-message when the requested COM component isn't registered.
>

Do you have a manifest for the client? Is it embedded? How does it look
like?


Willy.


Kasper G. Christensen

unread,
Apr 8, 2008, 2:50:37 AM4/8/08
to
>> My COM Client is written in Clarion (http://www.softvelocity.com/) and
>> the only error I get is "No OLE Automation Interface", which is the
>> normal error-message when the requested COM component isn't registered.
>
> Do you have a manifest for the client? Is it embedded? How does it look
> like?
>

I have a manifest for the client, and it is not embedded, but named
after the client: "stelpro7.exe.manifest" and placed in the application
directory. If I change the manifest to something illegal, I get error
messages on startup, so I take it that the manifest is read when I'm
starting the client.

The client manifest looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity type="win32"
name="stelpro7"
version="7.16.1.12" />
<dependency>
<dependentAssembly>
<assemblyIdentity name="Mamut.eDocServer.ComInterface"
version="1.0.0.0"
processorArchitecture="msil">
</assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

My server manifest is embedded in my .Net (COM interoperable) assembly,
and is generated by mt.exe. I have removed the dependencies from this
assembly, since mt.exe generates a dependency on mscorlib, and this
dependency fails, unless I'm placing mscorlib.dll in the appliation
directory. Even with mscorlib.dll in the app directory, I still get an
error message on startup, until I remove the dependency on mscorlib
Could this have something to do with my problems, or is it fine to omit
dependencies for the server dll?

Thank you for your time trying to answer my questions.

Best regards

Kasper

0 new messages