MSBuild Extension Pack: Convert Virtual Directory to Application

Jan 12, 2011 at 7:37 AM

Hi

I need to convert a Virtual Directory which I have added via MSBuild to an application and assign it to my application pool. I have added the Virtual Directory using the following code:

 

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

<MSBuild.ExtensionPack.Web.Iis7Website 
TaskAction="AddVirtualDirectory" 
Name="Default Web Site" 
VirtualDirectories="@(MyVirtualDirectory)" 
ContinueOnError="true"/>


Please advise whether what I am attempting is feasible.

Coordinator
Jan 12, 2011 at 8:21 AM

Wouldn't you rather AddApplication, e.g.

 

<Application Include="/MyApp">
            <PhysicalPath>C:\a</PhysicalPath>
            <AppPool>YOURAppPool</AppPool>
        </Application>
</ItemGroup>
	

<MSBuild.ExtensionPack.Web.Iis7Website 
TaskAction="AddApplication" 
Name="Default Web Site" 
Applications="@(Application)" 
ContinueOnError="true"/>

Jan 12, 2011 at 9:00 AM

Thanks Mike!

This was exactly the solution I was looking for. Seems as if I was missing Name="Default Web Site" or simply not doing it correctly.

Much appreciated.

Coordinator
Jan 12, 2011 at 9:13 AM

Great. Does this address your other discussion too http://msbuildextensionpack.codeplex.com/Thread/View.aspx?ThreadId=241304?

 

Jan 12, 2011 at 9:19 AM

Yes, indeed it does.

Just one last question: I see in a threaded dating July 2009 that you added a work item for deleting an application? Has that been addressed yet?

 

Coordinator
Jan 12, 2011 at 2:28 PM

I think so http://msbuildextensionpack.codeplex.com/SourceControl/changeset/changes/29761

 

        <!-- Delete Applications -->
        <MSBuild.ExtensionPack.Web.Iis7Application TaskAction="Delete" Website="NewSite" Applications="@(Application)"/>