I have two executables that reference the same Class Library. In the class library I have a static variable. How can that static variable persists on the two different executables?
This is how it looks:
public class MyClass
{
public static string MyVar;
}
App 1:
public class MyApp1
{
public void SomeMethod()
{
MyClass.MyVar = "hello";
}
}
App 2:
public class MyApp2
{
public void SomeOtherMethod()
{
if(MyClass.MyVar == "hello")
DoSomething();
}
}