title: MongoDB CountAsync and Cursors not working in a Windows Service with the new driver
body: <p>I have a Windows Service that reads data from a SQL Server and write them on MongoDB.</p>
  
  <p>I'm trying to adapt this service to the new MongoDB driver (using 2.0.1 version), but I'm facing some problems.</p>
  
  <p>I have this:</p>
  
  <pre><code> protected void OnStart(string[] args)
      {
          threadExternalPage = new Thread(new ThreadStart(FacadeFactory.GetLivePrice.UpdateExternalPage));
  </code></pre>
  
  <p>This code calls this method.</p>
  
  <pre><code> public async void UpdateExternalPage()
      {
          while (true)
          {
              MongoUpdateProductBO mongo = new MongoUpdateProductBO();
              await mongo.UpdateExternalPage();
          }
      }
  </code></pre>
  
  <p>Now the problem: everytime I call this line on mongo.UpdateExternalPage()</p>
  
  <pre><code>var count = await collection.CountAsync(new BsonDocument());
  </code></pre>
  
  <p>The method exits without processing the next instructions.</p>
  
  <p>The same thing happens if I execute this line:</p>
  
  <pre><code>using (var cursor = await collection.Find(filter).ToCursorAsync())
  </code></pre>
  
  <p>But if I do the same thing using a Windows Forms application, there's no problem! But I need this code working in a Windows Service. Does somebody know if I the implementation is wrong or if there's some restriction using new MongoDB driver?</p>