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

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

Post by Kasper G. » Tue, 18 Mar 2008 18:15:24


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.yqcomputer.com/ )

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
 
 
 

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

Post by Willy Deno » Tue, 18 Mar 2008 20:16:21


Check this:
http://www.yqcomputer.com/ (VS.80).aspx

Willy.

 
 
 

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

Post by Kasper G. » Wed, 02 Apr 2008 18:06:15

> Check this:

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
 
 
 

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

Post by Willy Deno » Thu, 03 Apr 2008 20:50:24


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.
 
 
 

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

Post by Kasper G. » Fri, 04 Apr 2008 17:56:05

> Not sure what errors you are getting,

My COM Client is written in Clarion ( http://www.yqcomputer.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.


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

Best regards

Kasper
 
 
 

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

Post by Willy Deno » Wed, 09 Apr 2008 01:00:26


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


Willy.
 
 
 

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

Post by Kasper G. » Wed, 09 Apr 2008 15:50:37

>> My COM Client is written in Clarion ( http://www.yqcomputer.com/ ) and

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