IIS WebDeploy using MS Build Fails with error MSB4

2019-04-06 02:46发布

In setting up a Jenkins deployment job, I kept running into this error when trying to deploy a Visual Studio 2012 Web project via the command line.

error MSB4044: The "ConcatFullServiceUrlWithSiteName" task was not given a value for the required parameter "SiteAppName"

For reference, here are the parameters that I used:

/p:Configuration=Release /t:Rebuild  /p:VisualStudioVersion=11.0 /p:PublishProfile="DeployToDevServer" 
/p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish 
/P:AllowUntrustedCertificate=True /p:MSDeployPublishMethod=WMSvc
/p:MsDeployServiceUrl=https://devmachine.server.com:8172/MsDeploy.axd 
/p:username=domainhere\adminuserhere /p:password=adminpasshere

Note: It would deploy just fine if I chose Publish... from inside the project.

2条回答
兄弟一词,经得起流年.
2楼-- · 2019-04-06 03:04

You could pass this DeployIisAppPath as parameter to Jenkins, like this: p:DeployIisAppPath=Default Web Site/sitenamehere This would allow you to have different sitenames on different machines. While in your example (with CSPROJ modification) you would be obliged to have one IIS site name on all target machines

查看更多
萌系小妹纸
3楼-- · 2019-04-06 03:05

After much googling, and finally comparing a project that would deploy with the one that wouldn't, I finally figured it out after I opened the .csproj files with a text editor and compared them. In the project that worked, I found this section:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

And it had this line:

<DeployIisAppPath>Default Web Site/sitenamehere</DeployIisAppPath>

I added this same line to the non-working project, changed the sitename, and it worked. Hope this helps someone else.

查看更多
登录 后发表回答