C# Reflection on already running process

Hello All,

I have two C# WinForm applications. When BOTH apps are running, I would like to use reflection in App A to get and set information in App B. I can do this already if App A uses refelection to load the App B assembly. Is there anyway to do the same if App B is already running?

Also, when I use reflection in App A to Load the App B Assembly, is App B still running in its own process? I don't see it in task manager, but I do see it on the desktop

Both App A and App B are forms
Windows 7 Pro 64
VS2013

Thanks very much,

Brian
Brian DumasSenior Software EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nadir Van ThielenCommented:
the way i do it is get the process memory address from the kernel32,
and get the info you need and r/w that address to the b app the same way but reversed.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Miguel OzSoftware EngineerCommented:
I do not think you can do this using reflection, you need to share information in a different way, some examples:
1. A file.
2.  A database table or tables.
3.  Inter process communication
4.  Web services (SOA, Web API)
Depending on your needs usually 1 and 2 will do the trick.
1
käµfm³d 👽Commented:
Agree with Miguel Oz, but I'd also add that perhaps the WinAPI could be used here as well...though it's more difficult to work with than the other suggestions.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Brian DumasSenior Software EngineerAuthor Commented:
Hello all, I am aware that I can use multiple number of ways to do IPC. What I needed in the beginning was a C# way of creating objects in App B. I have reflection working at this time that does just that, but it needs to 'start' App B for it to work. Just curious as to any method to do the same thing as I am doing now, without starting AppB (since in the actual environment App B will be running).

Thanks
0
Miguel OzSoftware EngineerCommented:
As per my post, the answer you can not do it with reflection, you shall use one of the IPC based suggested solutions.
 "when I use reflection in App A to Load the App B Assembly, is App B still running in its own process?"
 No, APP B  is running in App A process, thus the reason you can access all their values in your current code, if it is a separate process then it is not possible
0
Brian DumasSenior Software EngineerAuthor Commented:
Disagree with 'force accept', but not my decision.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.