title: Web deploy error - "Child object 'environmentVariables' cannot be added to object 'add'. The 'add' provider may not support this deployment."
body: <p>I've created a web deployment package (a ZIP file) for a WCF service hosted in an ASP.NET 4.5 web application. When I try to deploy the package I get the following error:</p>
  
  <pre><code>Child object 'environmentVariables' cannot be added to object 'add'.
  The 'add' provider may not support this deployment.
  </code></pre>
  
  <p>The stack trace is:</p>
  
  <pre><code>Microsoft.Web.Deployment.DeploymentException: Child object 'environmentVariables' cannot be added to object 'add'. The 'add' provider may not support this deployment.
     at Microsoft.Web.Deployment.DeploymentObject.AddChild(DeploymentObject source, Int32 position, DeploymentSyncContext syncContext)
     at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAddChild(DeploymentObject destParent, DeploymentObject sourceObject, Int32 position)
     at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
     at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)
     at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAddChild(DeploymentObject destParent, DeploymentObject sourceObject, Int32 position)
     at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
     at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)
     at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
     at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
     at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId)
     at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
     at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentWellKnownProvider provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
     at Microsoft.Web.Deployment.UI.InstallProgressWizardPage.OnWorkerDoWork(Object sender, DoWorkEventArgs e)
     at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
  </code></pre>
  
  <p>I haven't figured out how to fix this problem but I've noticed that the archive.xml in the deployment package ZIP file has an <code>&lt;environmentVariables&gt;</code> element nested inside an <code>&lt;add&gt;</code> element which is nested inside an <code>&lt;appPoolConfig&gt;</code> element.</p>
  
  <p>The source IIS site is in IIS Express (version 10 because I've also installed Visual Studio 2015 RC). The target IIS version is 7.5 (Windows Server 2008 R2).</p>
  
  <p>The web deployment package is created in Visual Studio 2013 running on Windows 7. The installed version of WebDeploy in Programs and Features is 3.6 (3.1238.1953).</p>
  
  <p>Does anyone know how to work around or fix this problem?</p>