Execute dlls in seperate process

M

Michaelov, Itzik

Hi

I have .NET dll written in C#
It's have a many classes and have many clients that use this dll.
Now i have request to run this dll out-of-process without change the
clients!
I don't know if there is simple way to do it (like in VB6 just to change dll
to ActiveX EXE)
Any suggestions ?

Thanks
 
P

Peter Duniho

Hi

I have .NET dll written in C#
It's have a many classes and have many clients that use this dll.
Now i have request to run this dll out-of-process without change the
clients!
I don't know if there is simple way to do it (like in VB6 just to change
dll to ActiveX EXE)
Any suggestions ?

Is it a COM DLL? If so, then I suppose there may be a way to configure
it as an out-of-proc COM server. That's outside the scope of this
newsgroup though; more of a COM question, than a C#/.NET question.
Though surely the solution will involve some change to the C# project,
to get the output appropriate for an out-of-proc COM server (i.e. change
it from DLL to EXE, in addition to the COM-related changes that have to
be made).

Otherwise, no. A DLL assembly inherently is intended to be used in the
context of some other executable that loads it. You can always wrap the
DLL in some EXE code of course, and define some API by which a different
process can interact with it. But whether you'd consider that "simple",
I don't know (the API doesn't have to be complicated, necessarily, but
it's not going to be trivial either).

Of course, the request begs the question: what benefit does your client
expect to achieve by running your DLL code as a standalone process?

Not that such things are unheard of. One possible use scenario would be
to have a single process that can act as a server for multiple other
client processes, to address some specific need to have the handling of
the multiple client processes coordinated somehow. But generally, one
would expect things to be _better_ running the code as a DLL rather than
a standalone EXE.

IMHO you should work to understand the client request better, so you
know what is the underlying goal they are trying to achieve. Just as
often in this newsgroup, we get questions from programmers who ask about
some specific implementation, when what they really need is advice about
whatever design led them to that implementation choice, clients of
third-party code may often ask for some specific change to the
third-party code, when in fact what they really need is advice as to how
to change their overall architecture to fit within a more sane usage of
the third-party code.

I think there's a good chance your client doesn't really need your DLL
code to run in its own process.

Pete
 
A

Arne Vajhøj

I have .NET dll written in C#
It's have a many classes and have many clients that use this dll.
Now i have request to run this dll out-of-process without change the
clients!
I don't know if there is simple way to do it (like in VB6 just to change
dll to ActiveX EXE)
Any suggestions ?

You need to create another DLL that is used in process that
communicates with another process that calls the original DLL.

If the DLL is not signed it should be easy to replace.

For communicating with the other process you can use
COM+, remoting or WCF.

Any chance you can persuade whoever is in charge to
go for other AppDomain instead of other process?

I think that would simplify the solution and would
provide sufficient isolation for most usage.

Arne
 

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

Similar Threads


Top