4

I had v1 of msdeploy installed and I uninstalled it to install the v2. Now my vs2010 packages fail when I run the deploy.cmd because it can't find the registry entry - even though I've created an MSDeployPath environment variable pointing to the v2 path?

I have MSDeployPath set to "C:\Program Files\IIS\Microsoft Web Deploy V2" in the Advanced System Settings/Environment Variables under My Computer/Properties.

The error I get when I run the VS2010 deploy.cmd file is: Files\IIS\Microsoft was unexpected at this time.

Anyone know how to fix this? The vs2010 package's deploy.cmd looks for /1 in the registry.

So how do I change this to look for /2 if the path variable doesn't work

Bernard
  • 1,983
  • 4
  • 18
  • 27

2 Answers2

4

Edit the .cmd file to look for the correct registry path. /2 instead of /1.

My understanding is that TFS 2010 sp1 fixes this.

The line from the cmd file for pre SP1 builds looks like this:

for /F "usebackq tokens=2*" %%i  in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`) do (

post SP1 it looks like this

for /F "usebackq tokens=1,2,*" %%h  in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy" /s  ^| findstr -i "InstallPath"`) do (
BNL
  • 7,085
  • 4
  • 27
  • 32
  • I've installed TFS 2010 SP1, and the .cmd file is still being generated with the old path. Did TFS 2010 SP1 really fix this issue? If so, did you have to reboot the server, or restart services? Just wondering, b/c I'm still having this issue. – Michael McCarthy Oct 24 '11 at 13:31
  • Added the exact difference I see in the cmd files to the answer. Everything I've seen indicates that SP1 does fix it. – BNL Oct 24 '11 at 13:38
  • Okay. If your SP1 application alone fixed the output of the deploy.cmd file, I did not get the same results. My deploy.cmd file is still pointing to: "for /F "usebackq tokens=2*" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`) do (". It's got to be something on my end I'm missing. Thanks. – Michael McCarthy Oct 24 '11 at 15:03
  • BNL, one more question for you. Do you have Visual Studio 2010 installed on your TFS server? – Michael McCarthy Oct 25 '11 at 14:42
  • No, just TFS and the Windows SDK. Don't think the latter matters. – BNL Oct 25 '11 at 15:05
  • FYI, I fixed this problem by adding an environmental variable called MSDeployPath as outlined in this post [link](http://stackoverflow.com/questions/5110600/deploying-asp-net-application-net4-0-package-on-to-iis-6-0) – Michael McCarthy Oct 25 '11 at 19:45
0

I also get the same issue when I am trying to deploy the web site using bath file under the package created by MSbuild. Only difference is I am doing it remotely.that is I assign that task to my build server and once a build is successful then it execute the command

    MVC-Client.deploy.cmd /y /M:es-websrv01

Although the set parameter xml is available it complains the it is unexpected.Normally it says for a remote web deployment we dont need admin privileges.(In my case build server is running with out admin privileges).Then I remotely logged to the build server machine and then using a command line try to to the deployment manually.But end up with the same issue.Then what I try was just copy the package in to a desktop and then did the remote deployment.It was successfully transferred the files into target IIS location.

Location where build server tries to to the deployment : C:\Program Files (x86)\Jenkins\jobs\Exile-LibrarySystem\workspace\Exile-LibrarySystem\Exile-LibrarySystem\obj\Staging\Package

I think since this folder has limits access it cant do the operation.Otherwise I should have end up with the same issue when I was trying to do the deployment in the desktop in build server machine. Is there any work around where I can get this deployment job done with in the build server location ?

Thanks

Eshan Sudharaka
  • 607
  • 2
  • 9
  • 16