Bogdan Verbenets
Bogdan Verbenets

Reputation: 26952

alternative to Remoting when dealing with cross-AppDomain calls

I have a .NET class library which I need to load to a separate domain and execute some code from it. Right now I am using AppDomain.CreateInstanceFrom to create a remoting object and unwrap it using some interface. But what alternatives do I have? Remoting is kind of obsolete technology.

Upvotes: 0

Views: 374

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1064324

Remoting is fine for cross-AppDomain, but the other approach is to pretend they are different processes on the same machine, or different machines.

For example, you could use a basic socket-server between the two, or something like WCF or Service Stack operating on a named-pipe (or similar). Or flat files in a known location and polling. Or a database table as a queue. Or a dedicated messaging stack - anything from MSMQ to redis pub/sub. Or a http server (HttpListener maybe) and client (WebClient maybe). Go wild.

Personally, I'd be tempted to stick with remoting if it works, though. Note I only say this between app-domains, in the way laid out in your post - I wouldn't personally use remoting between processes/machines.

Upvotes: 1

Related Questions