Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web deploy from a folder with spaces

I have a very simple scenario, ASP.NET MVC4 web site. I use the Publish functionality of VS2012 to generate web deploy package. This generates a bunch of files, one .zip, some .xml and a xxx.deploy.cmd file.

I run the deploy.cmd file as usual with the following command:

MVCTestApp.deploy.cmd /Y -enableRule:DoNotDeleteRule

When run from a subfolder of program files, which contains spaces(for instance C:\Program Files (x86)\Folder With Spaces\TestApp) this command fails with the error

\Folder was unexpected at this time.

The problem is apparently in the handling of the _DeploySetParametersFile parameter, but I can't just fix the .cmd file because it is generated on each publish.

Does anyone have a workaround for this?

like image 312
Ventsyslav Raikov Avatar asked Dec 03 '25 06:12

Ventsyslav Raikov


1 Answers

For me the issue was related to the link below (I was trying to get this to work in jenkins):

https://issues.jenkins-ci.org/browse/JENKINS-11992?focusedCommentId=201790#comment-201790

I worked around the issue by using the shortened versions of the directories. You can find out what what they are by typing dir /x.

My build command ended up looking like this:

MSBuild c:\PROGRA~2\Jenkins\jobs\REPVIE~1\workspace\Builder\RepView\RepView.csproj /p:DeployOnBuild=true /p:PublishProfile=JenkinsDeployment

My deploy command ended up looking like this:

c:\PROGRA~2\Jenkins\jobs\REPVIE~1\workspace\Builder\RepView\obj\Debug\Package\RepView.deploy.cmd /y /M:http://<target-address> /u:<username> /p:<password>

Because the deploy.cmd file is generated, using the shortened names for the directories when MSBuild is called, gets around this issue. Just don't use any paths with spaces and it should work for you.

like image 90
Chris B. Anilao Avatar answered Dec 05 '25 20:12

Chris B. Anilao