title: C# IIS programmatically site creation Missing Method
body: <p>I've written a small tool that installs a web application and all needed software packages on a windows server. The tool creates application pools and the needed applications. On my development machine everything works fine, but on a test server (fresh w2k8r2 install with iis) the tool crashes with the following exception:</p>
  
  <blockquote>
    <p><strong>System.MissingMethodException:</strong> Method not found: 'Void
    Microsoft.Web.Administration.ApplocationPool.set_Startmode(Microsoft.Web.Administration.Startmode)'</p>
  </blockquote>
  
  <p>This is the code I use to create the appPool:</p>
  
  <pre><code>using (ServerManager serverManager = new ServerManager())
  {
      try
      {
          if (!serverManager.ApplicationPools.Any(x =&gt; x.Name == appPoolName))
          {
              ApplicationPool appPool = serverManager.ApplicationPools.Add(appPoolName);
              appPool.ManagedRuntimeVersion = "v4.0";
              appPool.StartMode = StartMode.AlwaysRunning;
              appPool.ProcessModel.IdentityType = ProcessModelIdentityType.LocalSystem;
  
              serverManager.CommitChanges();
          }
  
          result = true;
      }
      catch (Exception e)
      {
          Console.WriteLine(e);
      }
  }
  </code></pre>
  
  <p>I have installed the IIS managament tools and scripts with the server manager. Am I missing a package or is my code wrong?</p>
  
  <p><strong>Update</strong>:</p>
  
  <p>As PhillipH wrote in his answer the IIS 7.5 does not support the property <code>StartMode</code>.</p>