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 the same issue: I created the project in VS 2010
, and had to publish from VS 2019
. None of the solutions here worked for me, and I'd been with the issue for about a day.
What did work came from this link: http://www.dotnetxp.com/visual-studio-error-publish-target-gatherallfilestopublish-not-exist-project/
This is what I did:
** Unloaded offending project.
** Open csproj file in text editor.
** Find this line
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
and replace with this. I use 16.0
because that's the version I'm using (vs2019).
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.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\v16.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
** Reload project and publish.
Worked like a charm.
Since the issue cannot be reproduced on my side, I would like to suggest you to try to reinstall the SDK.
Please try to remove the old SDK completely before installing the new one.
Best Regards,
Ming Xu.
Right click the project and select Edit (project name).csproj. (e.g. Edit in notepad) Look for Add the following above the line.
13.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) Save and Reload project.
This really work for me, Thanks
Same issue I have Fixed.
Please check if some files are missing into solution. if you are facing error like Error - The target "GatherAllFilesToPublish" does not exist in the project.
Then just open .proj file and delete this line <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
You get actual error or those missing files into solution
I realize this in an old question, but I ran into it recently and here is how I solved it.
Background: I had an old project that I upgraded to VS studio 13. It looks like the project file wasn't upgraded properly.
There are references to VS v10.0, in the csproj file, but I am running VS 13 which is really "v12.0".
So I told the csproj file to use the "v12.0" folder, not a "v10.0" folder.
This is what I had:
<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="$(SolutionDir)\..\BuildTools\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(SolutionDir)\..\BuildTools\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
This is what I changed it into:
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.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)' != ''" />
Now my publishing to the filesystem works!
I think that I know what the issue is. When you install the Azure SDK bits it installs some VS Web Publish updates. One of these updates the file at
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets
Based on how our setup is defined if that file has an updated timestamp (for whatever reason) then when you install the new component the file does not get updated.
To resolve this you should be able to follow the steps below:
Microsoft.WebApplication.targets
to Microsoft.WebApplication.targets.bak