0

我有一个 .NET 类库,我需要将其加载到一个单独的域并从中执行一些代码。现在我正在使用 AppDomain.CreateInstanceFrom 来创建一个远程对象并使用一些接口解包它。但我有什么选择?远程处理是一种过时的技术。

4

1 回答 1

1

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.

于 2012-08-09T09:01:25.553 回答