5

I tried to publish a web project from Visual Studio 2013 but kept getting this error using web deploy.

Web deployment task failed. Unknown ProviderOption: DefiningProjectFullPath. Known ProviderOptions are:skipInvalid.

Sunil Aher
  • 747
  • 3
  • 14
  • 34

6 Answers6

5

I had the same issue after installing update 4 for Visual Studio 2013.

Solution: Install the Visual Studio update on the build server.

Danny Varod
  • 17,324
  • 5
  • 69
  • 111
3

I had the same error.

I got this error after installing TFS RM Update2. What you need to do is replace the contents of "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web" on your build server with the contents of that same folder on your development pc.

This worked for me anyways.

Talon
  • 3,466
  • 3
  • 32
  • 47
3

I had this issue when I updated my Build server to compile using new roslyn compiler (to use c# 6 features) and after installing required stuff (The .NET 4.6 Framework, The Microsoft Build Tools 2015, The .NET Framework 4.6 targeting Pack) I got error on missing C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets when I tried to publish project ("Package" Msbuild target).

So I added /p:VisualStudioVersion=12.0 parameter MSBuild command that do publishing so the target from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets would be taken and then I got the error in question (Web deployment task failed. (Unknown ProviderOption:DefiningProjectFullPath. Known ProviderOptions are:skipInvalid.))

I got two solutions for this problem:

  1. Copy C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets from you local machine to build server and remove /p:VisualStudioVersion=12.0 parameter from MSBuild command argumens. The the new MSBuild (located at C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe') would by default set VisualStudioVersion as 14.0 and would use the new MSBuild target that works with new compiler.
  2. If you don't have access to build server then install MSBuild.Microsoft.VisualStudio.Web NuGet package (you need to install it to at least one project in solution) and then remove this /p:VisualStudioVersion=12.0 command argument from MSBuild and add below text to .csproj file of project that can't be published:
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != '' And Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')" />
<Import Project="..\..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" Condition="('$(VSToolsPath)' == '' Or !Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')) And Exists('..\..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets')" />  

This will first check if you have Microsoft.WebApplication.targets on build server (in ...VisualStudio\v14.0\ directory) and if not it will import the one from solution (included in packages directory)

If it won't work check if you have this in your .csproj file:

<PropertyGroup>    
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
Community
  • 1
  • 1
Mariusz Pawelski
  • 25,983
  • 11
  • 67
  • 80
1

Inside Visual Studio go to Tools -> Extensions and Updates -> Updates -> Product Updates

Install the latest Azure SDK (even if you are not using Azure).

Source

Also, I had this MSBuild Targets NuGet installed which was for VS2012 targets. I installed the version for my version of VS (2013) and everything was back to normal.

Jerther
  • 5,558
  • 8
  • 40
  • 59
0

I have Visual Studio 2013 but yesterday I installed also Visual Studio 2015, and give me the same error when try to publish a site in VS 2013.. I solved this just run update 5 of visual studio 2013

-1

I had this issue in VS 2013 after I installed the 2015 preview.

My solution is to publish from VS 2015 only...

Ian Newson
  • 7,679
  • 2
  • 47
  • 80