aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
256 stars 123 forks source link

VS 2017 Publish issue fixed #969

Open angelsix opened 7 years ago

angelsix commented 7 years ago

The issue you have in VS 2017 for publishing an ASP .Net Core website giving the error "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 2 item(s) can now be fixed.

Edit C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Publish.targets

Line 99 the command needs DestinationFiles changing to:

DestinationFiles="@(_ResolvedFileToPublishPreserveNewest -> '$(PublishDir)%(RelativePath)')"

And the line 127 command needs:

DestinationFiles="@(_ResolvedFileToPublishAlways -> '$(PublishDir)%(RelativePath)')"

Notice the subtle difference. The first is PreserveNewest, the second is Always.

Once edit restart VS and publishing will work

mlorbetske commented 7 years ago

cc @vijayrkn @srivatsn