The GetInfo() method of the MSBuild.ExtensionPack.Web.Iis7Website class obtains the ApplicationPoolName value from Microsoft.Web.Administration.Site.ApplicationDefaults.ApplicationPoolName - which is incorrect, as this value may not (and in very many cases will not) match the name of the application pool actually used by the root application of a website.
In my case it always returns 'DefaultAppPool', which is not the name of the application pool used by the site!
In my case it always returns 'DefaultAppPool', which is not the name of the application pool used by the site!