-1

I would like to assign user defined object to Process.StartInfo.Arguments in my parent process, So as to retrieve same object in my child process.

How can I do it.. please help

Anand TB
  • 17
  • 4
  • Very briefly: you don't, that's not how Windows (nor yet any POSIX-compatible OS) works. At all. There are a lot of ways around this, but most of them fall under general *IPC techniques* (q.v., hint, hint). – Nathan Tuggy Jan 02 '15 at 07:23

1 Answers1

1

You can serialize your object, either using XmlSerializer or BinaryFormatter and then deserialize it in the child process.

When using the latter, you have to add base64 encoding to get a string.

Please note that, starting from Windows 7, the maximum length for a command line string is 32768, so you should use another remoting technology for larger objects.

Community
  • 1
  • 1
Frank
  • 4,403
  • 12
  • 27