4

I'm not sure if this question makes sense, but it has been pretty hard to find information so far.

My objective is to "attach" a process to another one that is already running. I'm not trying to debug either of them, I just want to access objects/context from the last. I have read about ICorDebug interface, implemented an example with it (using DebugActiveProcess()) but couldn't simulate what i want to achieve.

My objective is to have a process running with a singleton instance in it and use this instance as a context in a second process (I have assemblies and type infos for both).

This is my first question here, be kind =)

NG_
  • 6,895
  • 7
  • 45
  • 67
MarcelNubi
  • 43
  • 4
  • have you looked into remoting the object, so it can be shared across multiple processes or even multiple workstations? https://en.wikipedia.org/wiki/.NET_Remoting – Frank Thomas Nov 21 '12 at 22:03
  • It will not work in his scenario. It is too slow. – Kirill Bestemyanov Nov 21 '12 at 22:07
  • What sort of permissions will your process have? – Cameron Nov 21 '12 at 22:09
  • @FrankThomas , I read(an tried today) about WCF, wich seems to be the follower of .net remote, but apperantly it does not expose the object, allowing only message passing through proxys, web-service like. Please correct me if i'm wrong. – MarcelNubi Nov 21 '12 at 22:15
  • @Cameron, the processes have admin permissions and are intended to run locally in the same machine. – MarcelNubi Nov 21 '12 at 22:17

1 Answers1

1

No you cannot access another processes address space. That would be a huge security violation. (In old windows and DOS you could).

Shared memory is one way to share data between processes: How to implement shared memory in .NET?

Community
  • 1
  • 1
Steve Wellens
  • 20,506
  • 2
  • 28
  • 69