So, to sum up the answers so far in this thread we have:  "Yes you can", and
"No you can't".  Hmm.  :-)

So, here's the deal.

To use a remote object you will, in practice, need access to metadata.  (You
need this at run-time for the remoting proxy, and ideally you want it at
compile time too, otherwise it's really hard work.)  There are two ways you
can make this metadata available to the client:

 (1) Give the client a copy of the assembly containing the object definition
 (2) Get the server to expose metadata, and use SOAPSUDS to import it on the
client.

(In either case this is something that you do during development.)  In case
(2) it really doesn't matter at all where the remoted class actually
resides - SOAPSUDS will simply build you a brand new DLL with all the
metadata you require.

So what if you're doing (1)?  Well it shouldn't matter here either - an
assembly is an assembly, it doesn't greatly matter whether it's a .EXE or a
.DLL.  So long as the types you plan to make accessible remotely are public,
the compiler will be able to use them.  But there is one fly in the
ointment:  Visual Studio .NET has a bizarre aversion to referencing EXEs.
This is a pain in the neck sometimes - there is no good reason for this.
The compilers are perfectly happy to use DLLs.  And you can even hack the
.csproj file to make VS.NET import stuff from a .EXE, it's just that the UI
prevents you from doing it without resorting to such hacks.

So if you are using option (1), and you need to build the client program in
Visual Studio.NET, then unfortunately you will need the types to be defined
in a DLL.  But unless both of those apply, it really doesn't matter at all.


--
Ian Griffiths
DevelopMentor

----- Original Message -----
From: "Sievert, James A" <[EMAIL PROTECTED]>


> > What I mean is, do you have to put the methods you want to
> > invoke across processes and/or AppDomains in a .dll assembly?
>
> In general, yes you do.
>
> >  Is it possible to invoke methods remotely that dwell in and
> > EXE assembly?
>
> ...without having type meta-data in the .dll?  It is possible if you don't
> mind using reflection-type method invocation, but you'll need a little
help
> from the exe.  Specifically, the .exe has to support a method along the
> lines of System.Type.InvokeMember().  Alternatively, you could do some
funny
> stuff by implementing a custom proxy or IMessageSink...

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to