You are trying to access the static member by two projects in the same program right? Not two separate programs.
If so, I think the misunderstanding you're having is between value types and reference types. You can update the shared variable from both projects, but those values won't propagate. I'll use a single class to demonstrate, rather than the two you're using.
static class Test
{
public static bool logged_in;
}
Test.logged_in = true;
var t = Test.logged_in;
Console.WriteLine(l); // prints true
Test.logged_in = false;
var f = Test.logged_in;
Console.WriteLine(f); // prints false
Console.WriteLine(t); // prints true
Notice how the value of t
wasn't updated when you changed the static member? That's because bool
is a value type, not a reference type. So, when you ask for the value, you receive a copy of the value, not a reference to the variable.
If the static member was a reference type though, you can observe different behaviour:
static class Test
{
public static string logged_in;
}
Test.logged_in = "true";
var t = Test.logged_in;
Console.WriteLine(l); // prints "true"
Test.logged_in = "false";
var f = Test.logged_in;
Console.WriteLine(f); // prints "false"
Console.WriteLine(t); // prints "false"