I have recently installed the new Azure development tools for Visual Studio 2010 service pack 1. Every time that I try to publish an existing website (using file system depl
I had a similar issue and resolved it by using the steps provided by Sayed.
The file I renamed was in the v10.0 directory though.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets.
The original file that was there was dated 18-Jan-2011, after renaming it with a .bak extensions then reinstalled KB2591016, publishing seems to be working again. The new date of the file Microsoft.WebApplication.targets is now 11-Aug-2011.
I had similar issue when I wanted to publish my ASP.Net application to Windows Azure. After many trial and error finally this solution worked for me. This does not need any renaming of files or any installation / reinstallation of hotfixes / patches. Here is what you have to do:
Open the ASP.Net project file (.csproj) in Wordpad / Notepad and find the line looking similar to this:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '8.0'" />
Replace it with line as given below:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
I've been struggling with the same problem with Visual Studio 2013 (and 2015).
The crucial fix for me was to add the VSToolsPath
property setting, which was missing in my project file, for whatever reason.
I added this into the <PropertyGroup>
directive:
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
As a side note: My project file is also referencing the v10.0 version of the Microsoft.WebApplication.targets
file, but that seems to be okay.
I had this problem, and it was fixed by adding:
<Target Name="GatherAllFilesToPublish">
</Target>
to the Project File.
Removing these installations solved the issue for me:
Reference
I have the same issue in VS2013, the solution I found was by creating a new empty web application project can copying the following lines from it into my old website project: At the top:
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<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" />