Question

The project I have uses msdeploy to publish a package to IIS. It deploys over an existing version of the project. within the web application, I have a virtual directory, but every time I deploy the project, the virtual directory disappears.

I am calling MSDepoly in the following manner:

 -source:package='d:\[...]\9.1.0.67\application\AppName.zip' -dest:auto,computerName="hostSite.com",userName="AutoInstall",password="****",authtype="NTLM",includeAcls="False" -verb:sync -enableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"d:\...\9.1.0.67\application\AppName.SetParameters.xml" -skip:objectName=binding -skip:absolutePath="info$" -skip:objectName=dirPath,absolutePath="help$",skipAction=Delete

as you can see at the end, I have the following skip rules:

-skip:objectName=binding -skip:absolutePath="info$" -skip:objectName=dirPath,absolutePath="help$",skipAction=Delete

The binding skip rule is working, but the virtual directory, info, is still getting removed from the web application. the virtual directory is nested within the help directory, so I added the skip action to skip deleting that folder as well.

I based all of this information from the following blog article, but my virtual directory, info, is still getting removed on deployment.

Please help!

Was it helpful?

Solution 2

I gave up on getting msdeploy to play nice. I just wrote a bat script that would be executed after msdeploy completed:

mkdir C:\inetpub\application_wwwroot\VirtualDirectoryPhysicalDir
ECHO adding read permissions to the app pool
cacls C:\inetpub\application_wwwroot\VirtualDirectoryPhysicalDir/t /e /g "IIS APPPOOL\MyAppPool":r
ECHO creating "info" virtual directory
C:\Windows\System32\inetsrv\appcmd add vdir /app.name:"WebApplication/AppVirtualDirectory" / /path:"/help/info" /physicalPath:"C:\inetpub\application_wwwroot\VirtualDirectoryPhysicalDir"
C:\Windows\System32\inetsrv\appcmd set vdir /vdir.name:"Medrio/MedrioWeb/help/info" /physicalPath:"C:\inetpub\application_wwwroot\VirtualDirectoryPhysicalDir"

OTHER TIPS

I encountered the same issue. In development it appears the following skip rule prevented the Virtual Directory from being removed by MSDeploy.

-skip:ObjectName=virtualDirectory,absolutePath=.*NameOfVirtualDirectory

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top