How to set the application pool automatically during Microsoft Visual Studio 2010 web application and web service deployment

During the Visual Studio 2010 Web Application and Web Service deployment the prior setting of the application pool name is lost. The installer does not assign the correct application pool to the virtual directory, it will be assigned to the Default Application Pool. If different .NET versions are assigned to the same application pool, the older .NET applications stop …