Skip to content
Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
Close

Search

Home/Software Development/Development tools/Microsoft Visual Studio/How to set the application pool automatically during Microsoft Visual Studio 2010 web application and web service deployment
Microsoft Visual Studio

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

By Laszlo Pinter
April 2, 2013 2 Min Read
0

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 working.

To handle this problem in the VS 2010 msi file follow the steps below.

  1. Remote desktop into the web server and in the IIS manager create an application pool for your web application.
  2. Save the following program as SetAppPool.vbs to a common location in your file structure
    ' Sets the Application Pool of the Virtual Directory
    ' Usage:
    ' Right click on the Web Setup project
    ' Select Add, File
    ' Select C:\TFS\HALTeam\Other\Deployment_Tools\SetAppPool.vbs
    ' Right click on the Web Setup project
    ' Select View, Custom Actions
    ' Right click on Commit and select "Add Custom Action"
    ' Select the SetAppPool.vbs file in the Web Application Folder
    ' In the Properties window of SetAppPool.vbs enter the CustomActionData:
    '   Example: /vdir:HALGraphicUpload /appPool:HALGraphicUpload
    Option Explicit
    Dim customActionData, customActionArray, vdirName, appPool, vdirObj
    ' Read the CustomActionData of the Installer
    customActionData = Session.Property("CustomActionData")
    ' Parse the data from the CustomActionData
    customActionArray = Split(customActionData) ' Splits by the space
    vdirName = Replace(customActionArray(0), "/vdir:", "")
    appPool = Replace(customActionArray(1), "/appPool:", "")
    ' Set the Application Pool property of the Virtual Directory
    set vdirObj=GetObject("IIS://localhost/W3svc/1/Root/" & vdirName)
    vdirObj.Put "AppPoolId", appPool
    vdirObj.SetInfo

     

     

  3. Add the SetAppPool.vbs file to the Setup Project
    1. Right click the setup project
    2. Select “View”, “File System”
    3. On the left side right click the “Web Application Folder” and select “Add”, “File…”
    4. Browse to the “SetAppPool.vbs” file
  4. Add a custom action to the setup project
    1. Right click the setup project
    2. Select “View”, “Custom Actions”
    3.  Right click on “Commit” and select “Add Custom Action”
      1. Double click the “Web Application Folder”
      2. Select “SetAppPool.vbs” and click the “OK” button
    4. On the left side of the screen right click”SetAppPool.vbs” and select “Properties Window”
    5. Enter the following into the CustomActionData field
      /vdir:YOUR_VIRTUAL_DIRECTORY_NAME /appPool:YOUR_APPLICATION_POOL_NAME
      (make sure there is only one space before /appPool and there are no other spaces and quotes in the text)

Tags:

VisualStudio
Author

Laszlo Pinter

Follow Me
Other Articles
Previous

How to set up Internet Explorer to debug with Microsoft Visual Studio

Next

How to modify a WordPress theme

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Last Changes

  • DevOps Engineering part 1. (Mac) - Make your Macintosh easier to use June 25, 2026
  • Japan travel tips June 22, 2026
  • How to stop the rain and snow in Cities: Skylines II June 20, 2026
  • Cities: Skylines II Developer Mode June 20, 2026
  • 'CSII_MANAGEDPATH' has incorrect path(s) when building Cities: Skylines II mod June 20, 2026

Tags

.NET .NETcore 3Dprinting ASP.NET Core AutodeskInventor AWS C# Chef cloud DevOps Docker EntityFramework Games Git Go iOS iPad iPhone iPod Java Kubernetes Linux MacOSX MSSQL MVC Node.js Packer PowerShell Python RDS RightScale Ruby security Splunk TeamCity Terraform TestKitchen Tomcat Ubuntu Vagrant VirtualBox VisualStudio Windows WordPress Xcode

Recent Comments

  • Zengei László on MyHeritage családfa exportálása és küldése emailben
  • Raúl Castillo on DynDns update error
  • MICHAEL on Windows Media Player 12 cannot find the album information
  • Nargis on Configure Epson ET-3850 scanning on Windows 11
  • Venczelné Zemen Erika on Delta S2302 termosztát programozása

–

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright 2026 — Pinter Computing. All rights reserved.