title: Using System.ServiceProcess in C#
body: <p>I'm trying to gain access to the <code>ServiceController</code> class from within a custom build activity. </p>
  
  <p>So far here is the code I have:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Activities;
  using System.ServiceProcess;
  
  namespace Test.Build.Activities
  {
      public sealed class ResetCaches : CodeActivity
      {
          int timeWaited = 0;
  
          ServiceController Services();
      }
  {
  </code></pre>
  
  <p>The error I'm seeing is for the <code>ServiceController Services();</code> declaration:</p>
  
  <pre><code>The type or namespace ServiceController could not be found
  </code></pre>
  
  <p>I'm pretty new to C# (I've been using VB mostly) but I thought I would be able to reference the classes within <code>ServiceProcess</code> by pulling it in through a <code>using</code> statement.</p>
  
  <p>For reference, I'm going off of the information at <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller%28v=vs.110%29.aspx?cs-save-lang=1&amp;cs-lang=csharp#code-snippet-1" rel="nofollow">this</a> article.</p>
  
  <p>If I'm missing some key concept, just point me in the right direction and I'm happy to do more investigation on my end.</p>