Skip to content

Attaching to Another Process

Shai S edited this page Jan 10, 2022 · 2 revisions

✳️ Setup

To start playing with a remote process you need to create a RemoteApp object like so:

Process target =  Process.GetProcessesByName("OtherDotNetAppName").Single();
RemoteApp remoteApp = RemoteApp.Connect(target);

RemoteApp is your root object for any remote interaction.
This object represents the "link" from you app and the attachee.
RemoteApp implements IDisposable and it should only be disposed once all remote
interactions are complete. Disposing breaks the link between the apps and so, for example, retrieved objects (which are not of a primitive type) will stop working once that happens.

Clone this wiki locally