Question

How do I get the runCommand provider to work in the Manifest.xml of a MS Deploy package when installed via the Web Platform Installer?

I'm trying to build a simple test MS Web Deploy package installable by the Web Platform Installer via a custom feed. I'm trying to use the runCommand provider in the Manifest.xml file:

<?xml version="1.0" encoding="utf-8" ?>
<msDeploy.iisApp>
  <iisApp path="IISWSGISampleApp" />
  <runCommand path="set" />
</msDeploy.iisApp>

The set is used just to output the environment the command is run under, but it doesn't work for any number of different path values. When I install the package via the Web Platform Installer with any path attribute I get the same error:

[13:54:312]Source runCommand (set) does not match destination (set) differing in attributes (isSource). Update pending.
[13:54:315]Updating runCommand (set).
    Details:
    operationType: Update
    providerName: runCommand
    path: set
EXCEPTION: System.IO.FileNotFoundException: Could not find file '\\?\C:\Users\rpatterson\Documents\My Web Sites\IISWSGISampleApp'.
File name: '\\?\C:\Users\rpatterson\Documents\My Web Sites\IISWSGISampleApp'
...

It installs just fine if I remove the <runCommand> element from the Manifest.xml. I have also confirmed that the C:\Users\rpatterson\Documents\My Web Sites\IISWSGISampleApp does exist when WebPI shows the error. Also, I found out that the \\?\ style paths are for safely referencing long paths in Windows, so it may be that some part of long path support is broken.

I'm doing all this under Windows 7 Professional, Web Platform Installer 4.0, and Web Matrix 2.0 RC whose about dialog says:

Version 2.0 RC
WebMatrix: 7.1.1587.0
IIS Express: 8.0.8298.0
.NET Framework: 4.0.30319.17379 built by: FXBETAREL
Web Deploy: 7.1.1516.0
SQL Server Compact: 4.0.8854.1
Web Platform Installer: 7.1.1586.1
ASP.NET Web Pages: 2.0.20505.0
ASP.NET Web Pages: 1.0.20105.407

The code behind all this is in IISWSGI on GitHub, use this commit to test. To reproduce the environment I'm using, see the IISWSGI documentation.

Was it helpful?

Solution

I was once able to use runCommand without error after having been able to reproduce the error having done nothing but some combination machine reboot and using WebPI to install the app in between. After further testing, I can now reproduce the error by:

  • reboot the machine
  • use WebPI to install the app
  • exit WebPI
  • use WebPI to install the app again (without rebooting)

Then if I reboot the machine I can use WebPI to install the app again. IOW, it appears that WebPI has a bug where it can't be launched twice without rebooting the machine.

OTHER TIPS

Try moving your set command into a .bat / .cmd and referencing that as the path for runCommand. As long as you pass no arguments to the file, it will be included in the package and run when you sync the package elsewhere.

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