3
I am developing a Windows Form application in C#, and this application can run simultaneously several times on the same computer.
And I am doubtful whether or not I should use static objects (classes, functions, variables, etc.), as they may receive different values at program startup.
Then I wonder if the various instances of the same program will share the same information from the static variable?
Example:
- There is a static variable To;
- When the first instance is opened it receives 1
- When the second instance is opened it receives 2
In the first instance the variable To will continue to be 1?
No. Each instance of the application is a different Appdomain and each Appdomain will have its own static variables.
– Jéf Bueno