Outprocess (EXE) COM server in C#

G

Guest

Is there any way to build Outprocess (EXE) COM server in C#?
The only examples of interop I found are Inprocess (DLL) COM servers...

Thanks,
Slava Gomzin
Senior Software Engineer
Retalix Ltd.
(e-mail address removed)
http://www.retalix.com
 
O

Ostap Radkovskiy

I have the same question. I need to have an outprocess component with some
configuration file. The problem with ordinary inprocess COM is that my DLL
does not know where it's .config file reside as well as .NET studio doesn't
put .config file to binary files directory (because it's class library)

Thanks for further suggestions,
Ostap Radkovskiy,
SoftServe, Inc
 
N

Nicholas Paldino [.NET/C# MVP]

Ostap and Slava,

The closest thing you can do to creating an out of process com server is
to either a) create an Exe that exposes objects through remoting or B) to
create a serviced component that exposes one object and does not pool the
object.

However, neither of these will give you the exact functionality you
want. If you only have .NET clients though, I would recommend going with
option a.

Hope this helps.
 
N

Nicholas Paldino [.NET/C# MVP]

Slava,

You are right about C and D, but with the disadvantages associated with
them, I didn't think that they would be too feasable.

If you create a serviced component that lives out-of-process, then it
will act like an out of process ActiveX EXE. However, you have to set it so
that it uses an object pool, and that the max pool size is one, as well as
the minimum pool size (effectively creating a singleton).

This is pretty much the semantics that an ActiveX exe provides.

Hope this helps.


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

Slava Gomzin said:
Nicolas,

Thanks for your answer.
Could you please add more details regarding option B?
By the way, there are 2 another options - let's call them C and D (I'm currently using C):
C) Build out-of-process (Exe) COM server in unmanaged C++ which calls C# in-process DLL using interop;
D) Build out-of-process (Exe) COM server in unmanaged C++ which calls C# objects directly using ability
of C++ to call managed objects from unmanaged code. I didn't try it yet.
Unfortunately, those options have following disadvantages:
- using C++ code;
- using unmanaged code.

Regards,

Slava Gomzin
Senior Software Engineer
Retalix ltd.
(e-mail address removed)
www.retalix.com


----- Nicholas Paldino [.NET/C# MVP] wrote: -----

Ostap and Slava,

The closest thing you can do to creating an out of process com server is
to either a) create an Exe that exposes objects through remoting or B) to
create a serviced component that exposes one object and does not pool the
object.

However, neither of these will give you the exact functionality you
want. If you only have .NET clients though, I would recommend going with
option a.

Hope this helps.


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

Ostap Radkovskiy said:
I have the same question. I need to have an outprocess component with some
configuration file. The problem with ordinary inprocess COM is that my DLL
does not know where it's .config file reside as well as .NET studio doesn't
put .config file to binary files directory (because it's class library)
Ostap Radkovskiy,
SoftServe, Inc
 
O

Ostap Radkovskiy

Thanks for reply Nocholas,

I just found a workaround for my problem by manually reading xml .config
while using the location of dll

Ostap Radkovskiy,
SoftServe, Inc

Nicholas Paldino said:
Ostap and Slava,

The closest thing you can do to creating an out of process com server is
to either a) create an Exe that exposes objects through remoting or B) to
create a serviced component that exposes one object and does not pool the
object.

However, neither of these will give you the exact functionality you
want. If you only have .NET clients though, I would recommend going with
option a.

Hope this helps.


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

Ostap Radkovskiy said:
I have the same question. I need to have an outprocess component with some
configuration file. The problem with ordinary inprocess COM is that my DLL
does not know where it's .config file reside as well as .NET studio doesn't
put .config file to binary files directory (because it's class library)

Thanks for further suggestions,
Ostap Radkovskiy,
SoftServe, Inc
 

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