This project is read-only.

MSBuild ExtensionPack: Add application under Default Web site

Jan 11, 2011 at 2:35 PM



I am attempting to add an application under Default Web Site using MSBuild Extension Pack. I am able to add websites in the same level as default web site, and also to add virtual directory under Default Web Site, but somehow I can't find the code to add an application directly.


Does anyone have any clue how to do this? The other option is to create a virtual directory under Default Web Site and convert that VD to an app, but I can't find examples of how to do this.


Please assist.

Jan 11, 2011 at 10:58 PM

IIS 6 or IIS 7?


Can you post the scripts you are using.



Jan 12, 2011 at 6:16 AM

Hi Mike


The code as I currently have it is as follows:


<ItemGroup> <Application Include="/IntelliApp"> <PhysicalPath>c:\inetpub\</PhysicalPath> <AppPool>IntellibureauWebAppPool</AppPool> </Application> <VirtualDirectory Include="/MyVdir"> <ApplicationPath>/</ApplicationPath> <PhysicalPath>$(InstallationPath)\$(InstallationFrontEnd)</PhysicalPath> </VirtualDirectory> </ItemGroup>


  <Application Include="/IntelliApp">
  <VirtualDirectory Include="/MyVdir">

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Create" Name="$(FrontEndWebSite)" Path="$(InstallationPath)\$(InstallationFrontEnd)" Port="80" Force="true" AppPool="$(FrontEndApplicationPool)" Condition=" $(Item) == 'All' or $(Item) == 'FrontEnd' "  VirtualDirectories="@(MyVirtualDirectory)" />
<MSBuild.ExtensionPack.Web.Iis7Website Path="$(InstallationPath)\$(InstallationFrontEnd)" TaskAction="AddApplication"
Applications="@(Application)" />

This will create a website on same level as default web site and then create the application inside that website. Instead what I need is simply to create an application with "Default Web Site" as its parent. 
As I said earlier I also achieved creating a virtual directory inside Default Web Site but could not convert that virtual directory to an application.

Please advise.

Jan 12, 2011 at 3:28 PM

Resolved here :