Question

I can publish without issues in Visual Studio 2010 but when I attempt to publish with Visual Studio 2013 I am getting this message:

The target "MSDeployPublish" does not exist in the project. \Source2\Web Projects\SubService\subservice\subservice.csproj 0 0 subservice

Can anyone tell me what I need to do to resolve this? It's happening with 2 different projects.

Was it helpful?

Solution 3

after 4 hours I found a post not directly related to this but I took a blind shot and it worked:

Install from "Web Platform Installer" I installed the "Windows Azure SDK for .Net (VS 2013)" and that worked !

OTHER TIPS

For what its worth;

I had the same issue. Fresly installed Windows 8.1 machine, only installed Visual Studio 2013 (+update1) + Azure SDK's . Create new Web Api Project boom build error -

The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

note the v10.0. This is the default fallback when no MSBuild parameter "VisualStudioVersion" has been set. Prior to VS2012 the paths to the target files were hardcoded. Other solutions for this bugs say to remove the following from your csproj which is added for backward compatibility:

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>

But removing this fixes your builds but breaks the publish feature with the original posters error:

The target "MSDeployPublish" does not exist in the project

Note: I have all Azure related SDK parts installed from the web platform installer.

I have resorted to re-adding the above XML part to my csproj file but changing the 10.0 part to 12.0 (=vs2013)

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>

This might break backward compatibility but finally made my Visual Studio 2013 compile the code & made the publish feature work again.

If you don't want to install visual studio on build server, 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" />

Solution originally posted here: Where is MsDeployPublish located? (in my case it was already MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0).

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