title: Static variables generating problems with C# (Windows 8)
body: <p>I am not a used C# programmer, so if this is stupid, sorry :-)</p>
  
  <p>I am developing a C# app for Windows 8. I need to do a web request, and therefore, I have a callback to handle the request data.</p>
  
  <p>I am using the standard approach:</p>
  
  <pre><code>private static ManualResetEvent allDone = new ManualResetEvent(false);
  
  private static void daCallback(IAsyncResult data) {
     ...
     SampleDataSource.allDone.Set();
  }
  
  // This is the Class CONSTRUCTOR
  public SampleDataSource() {
     # before anything, reset allDone:
  
    string request = "http://some.url.com";
    HttpWebRequest webRequest = WebRequest.Create(request) as HttpWebRequest;
    webRequest.Method = "POST";
  
    webRequest.BeginGetResponse(new AsyncCallback(daCallback), webRequest);
  
    Debug.WriteLine("Asked to begin get response");
  
    SampleDataSource.allDone.WaitOne(12000);
  
    Debug.WriteLine("Done Waiting");
     #...
  }
  </code></pre>
  
  <p>When running, allDone (inside do_something) is not initialized. I even added a condition around to compare allDone with null, and yep, it is null.</p>
  
  <p>The "Done Waiting" message never gets print at all...</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thank you</p>