EXE COM Server Possible in C#? 
Author Message
 EXE COM Server Possible in C#?

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; };
        }

Quote:
}

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: GuidAttribute("3CB628E1-D8CD-11CF-B92D-
00AA00BBDD52")]

Any ideas?



Sat, 18 Dec 2004 13:16:08 GMT  
 EXE COM Server Possible in C#?
I thing there is no direct way to create out-of-process
COM server in C#. I have developed my server in VC++ as in-
process COM and exposed one object for registration of all
class objects of EXE server (CoRegisterClassObject..).
When my C# exe appl. is called with '-Embedding' parameter
I call exposed registration function. But this is not
solution to expose C# objects. I have found
RegistrationServices.RegisterTypeForComClients method in
Help but have no experience with.

Honza

Quote:
>-----Original Message-----
>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

>[assembly: GuidAttribute("3CB628E1-D8CD-11CF-B92D-
>00AA00BBDD52")]

>Any ideas?
>.



Sat, 18 Dec 2004 16:34:31 GMT  
 EXE COM Server Possible in C#?
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]


Quote:
> 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

> [assembly: GuidAttribute("3CB628E1-D8CD-11CF-B92D-
> 00AA00BBDD52")]

> Any ideas?



Sat, 18 Dec 2004 22:29:09 GMT  
 EXE COM Server Possible in C#?
This is unfortunate.  I wanted to use the C# language, but
the replacement app must have a GUI as well as an exposed
COM interface.  So, it looks like C# has not become a full
replacement of C++ yet.

Does anyone know why Microsoft decided not to support EXE
COM servers with C#?

Quote:
>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
Quote:
>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.



Sun, 19 Dec 2004 01:57:11 GMT  
 EXE COM Server Possible in C#?
Brian,

    It was never meant to be a replacement of C++.

    As for not supporting EXE COM servers, the COM+ serviced component is
meant to be the replacement.  However, you can still develop these in VB
(God forbid) and in VC++ (the better solution).

    Why not design the business functionality so that it resides in the
components and then create a GUI that accesses the serviced component?

--
               - Nicholas Paldino [.NET MVP]


Quote:
> This is unfortunate.  I wanted to use the C# language, but
> the replacement app must have a GUI as well as an exposed
> COM interface.  So, it looks like C# has not become a full
> replacement of C++ yet.

> Does anyone know why Microsoft decided not to support EXE
> COM servers with C#?

> >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.



Sun, 19 Dec 2004 04:14:07 GMT  
 EXE COM Server Possible in C#?
This application is actually a technical product (a
microwave frequency calibration product in combination
with the software for a semiconductor wafer probing
station).  So, all this stuff about business layers and
ASP and so forth that I see in the literature is nigh
useless.  We liked using COM as a means of object
encapsulation within separated processes.

The current project I'm working on is meant to be a quick
development of a proxy to allow a legacy client app to
talk to an alternate prober.  So, I want a program to act
in the place of the normal EXE COM server and convert/send
the requests to a remote wafer prober across a GPIB bus.  
There is no mandate to allow a redesign of the client
(because of political ramifications).

I'm already writing it in C++, but I had hoped that C# was
a drop-in replacement, as I like the idea of having
garbage collection, better run-time error checking, and
more automated type conversion.  C# just turns out to be
less wordy and more safe than C++.  Thankfully,
performance is not an issue for this application.

I have not yet done any work with serviced components, but
they sound interesting.  I'll definitely do some reading,
as I had thought they were mainly used in IIS based
systems, not free-form COM systems.

Brian

Quote:
>-----Original Message-----
>Brian,

>    It was never meant to be a replacement of C++.

>    As for not supporting EXE COM servers, the COM+

serviced component is
Quote:
>meant to be the replacement.  However, you can still
develop these in VB
>(God forbid) and in VC++ (the better solution).

>    Why not design the business functionality so that it
resides in the
>components and then create a GUI that accesses the
serviced component?

>--
>               - Nicholas Paldino [.NET MVP]



>> This is unfortunate.  I wanted to use the C# language,
but
>> the replacement app must have a GUI as well as an
exposed
>> COM interface.  So, it looks like C# has not become a
full
>> replacement of C++ yet.

>> Does anyone know why Microsoft decided not to support
EXE
>> COM servers with C#?

>> >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.

>.



Sun, 19 Dec 2004 07:37:48 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Lifetime of EXE COM server that uses DLL COM server

2. Serialize access to COM exe Server (long)

3. Using one COM exe server within another

4. COM servers in EXE

5. COM EXE Server - please make me sane

6. COM EXE Server Registration?

7. COM exe server

8. Shutdown EXE COM Server

9. Using BSTR in COM Exe server

10. COM Exe Server locking...

11. Beep problem with COM EXE server after 30 minutes

12. Problems using a ATL COM EXE Server with VB Client

 

 
Powered by phpBB® Forum Software