Where is MsDeployPublish located?
Asked Answered
E

3

12

When trying to deploy my site using TeamCity and Web Deploy I get this error:

error MSB4057: The target "MsDeployPublish" does not exist in the project.

Is there something I have to install on a build server? It's a clean Windows Server 2012 with Web Deploy 3.5 installed.

Eversion answered 10/10, 2013 at 12:32 Comment(0)
S
6

I realise this question is quite old at this point, but:

MsDeployPublish is installed with the Web Application targets as part of Visual Studio. If you have only installed Server + Web Deploy, you'll need to either copy them from your developer installation or install Visual Studio. The targets can be copied from %programfiles(x86)%\MSBuild\Microsoft\VisualStudio

As an aside, there are some features that were added after the release of Visual Studio 2012, namely those that relate to Publishing Profiles (.pubxml). Those can be added to VS2010 by installing the Azure SDK and will be installed to %programfiles(x86)%\MSBuild\Microsoft\VisualStudio\v10.5\Web

Superfluous answered 21/10, 2013 at 12:7 Comment(1)
This resolved my problem. I'd only installed the Server version of WebDeploy on my workstation. I needed to install the full version of WebDeploy in order to build properly.Whimsicality
A
17

Or you can use this NuGet package with portable version of the targets: https://www.nuget.org/packages/MSBuild.Microsoft.VisualStudio.Web.targets and modify your csproj file to include it like this:

<Import Project="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.12.0.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" />
Adaurd answered 16/6, 2014 at 13:51 Comment(2)
This is the best answer for TeamCity on a build server, if you don't want to have to install Visual Studio. A couple of things to note - make sure the path reference matches the version of Web.targets you install, and make sure the Import line above replaces any other Import references for Microsoft.WebApplication.targets (they may be further down in the web.config file), otherwise you'll get a "The 'exists' function only accepts a scalar value" compile error.Slumberous
@Raelshark's comment: I'm not sure if I just got lucky and it all matched up, but by just adding the nuget package it worked for me. The nuget included 14.0.0.3, some other steps before made my copy folder C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14` to the agent server. That in turn matches the ToolsVersion` in the build configuration. Teamcity and their documentations... :(Knott
S
6

I realise this question is quite old at this point, but:

MsDeployPublish is installed with the Web Application targets as part of Visual Studio. If you have only installed Server + Web Deploy, you'll need to either copy them from your developer installation or install Visual Studio. The targets can be copied from %programfiles(x86)%\MSBuild\Microsoft\VisualStudio

As an aside, there are some features that were added after the release of Visual Studio 2012, namely those that relate to Publishing Profiles (.pubxml). Those can be added to VS2010 by installing the Azure SDK and will be installed to %programfiles(x86)%\MSBuild\Microsoft\VisualStudio\v10.5\Web

Superfluous answered 21/10, 2013 at 12:7 Comment(1)
This resolved my problem. I'd only installed the Server version of WebDeploy on my workstation. I needed to install the full version of WebDeploy in order to build properly.Whimsicality
C
4

This worked for me, i had to add the line to import Microsoft.WebApplication.targets Got that from a good VS2013 project.

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
Clarissa answered 9/9, 2014 at 18:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.