Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
1.33/5 (3 votes)
See more:
I have two exe say console application 1 and console application 2 ,devloped in c#.net.Now first application create one object say 'obj' of type class x, now i want to access this created object 'obj' in second application.
Posted
Comments
Sergey Alexandrovich Kryukov 1-Nov-12 0:21am    
Bad, really bad idea. Processes are isolated for good reasons. Better use IPC. Even better, make self contained application. Believe or not, integration is a bad thing.
--SA
Sushil Mate 1-Nov-12 0:38am    
SA, Please check my solution.
bbirajdar 1-Nov-12 4:45am    
All the solutions downvoted ? What a waste of time...

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Nov-12 1:57am    
Not sure it would work for to answer the question (except remoting, of course), because it looks like it all talks about Application Domains of the same process. I've chosen not to answer because there is no clear justification for IPC which is always best to avoid...
--SA
Sushil Mate 1-Nov-12 1:58am    
OK. let's see if he clarifies further :)
Sergey Alexandrovich Kryukov 1-Nov-12 2:08am    
Well, if it ever happens... :-)
--SA
 
Share this answer
 
You need to use serialization. The two most important reasons are to persist the state of an object to a storage medium so an exact copy can be recreated at a later stage, and to send the object by value from one application domain to another. For example, serialization is used to save session state in ASP.NET and to copy objects to the clipboard in Windows Forms. It is also used by remoting to pass objects by value from one application domain to another

More info here[^]

Serialization in .NET[^]
Introducing Serialization in .NET[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900