create a COM+ component - it was "Re: EXE COM Server Possible in C#? "

J

john

Nicholas,

Where do we find an example that does a EXE COm server in .net?

John,



Message 3 in thread
From: Nicholas Paldino [.NET/C# MVP] ([email protected])
Subject: Re: EXE COM Server Possible in C#?


View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2002-07-02 07:34:37 PST


Brian,

You can not do it as a stand alone EXE. However, I find that creating
an serviced component (one that derives from ServicedComponent in the
System.EnterpriseSerivces namespace) so that I can create a COM+ component
works just as well. You can create components that are run as
out-of-process servers.

Hope this helps.
 
N

Nicholas Paldino [.NET/C# MVP]

John,

I would not create an EXE COM server in .NET. Rather, I would use
remoting, or I would create an object that derives from ServiedComponent,
and register it in COM+ so that it runs out-of-process. This way, you get
the application isolation that you want.

I would recommend taking a look at the section of the .NET framework
documentation titled "Writing Serviced Components", located at (watch for
line wrap):

http://msdn.microsoft.com/library/d...guide/html/cpconwritingservicedcomponents.asp


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

john said:
Nicholas,

Where do we find an example that does a EXE COm server in .net?

John,



Message 3 in thread
From: Nicholas Paldino [.NET/C# MVP] ([email protected])
Subject: Re: EXE COM Server Possible in C#?


View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2002-07-02 07:34:37 PST


Brian,

You can not do it as a stand alone EXE. However, I find that creating
an serviced component (one that derives from ServicedComponent in the
System.EnterpriseSerivces namespace) so that I can create a COM+ component
works just as well. You can create components that are run as
out-of-process servers.

Hope this helps.


--
- Nicholas Paldino [.NET MVP]
- (e-mail address removed)

Brian Smith said:
I need to replace a legacy EXE automation server, and I
would prefer to use C#. However, all the examples of COM
servers implement inproc servers (DLL's) instead of local
servers (EXE's).

Using VS.NET, I created a normal C# project (Windows
application) to create an EXE. Then, I added an
appropriate namespace with two classes to implement the
interface and implementation of the COM obj.
Like this:

namespace OldAppName
{

[Guid("BB3F5BD5-667E-11D1-925E-00A0C9322737")] //
interface GUID
public interface IComObjInterface
{
bool IsBusy();
}

[Guid("AB688A11-7025-11D1-9267-00A0C9322737")] //
clsid GUID
public class IComObj : IComObjInterface
{
bool IsBusy() { return false; };
}
}


When I use regasm, I see that the COM object is only
registered as an inproc server! There is no entry to
specify how to create IComObj as a CLSCTX_LOCAL_SERVER COM
object from a legacy COM client.

I've even added a key file and assembly guid to the
project's assembly, but it doesn't seem to make any
difference (see below).
[assembly: AssemblyKeyFileAttribute
(@"..\..\ProberProxy.snk")]
[assembly: GuidAttribute("3CB628E1-D8CD-11CF-B92D-
00AA00BBDD52")]

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top