"dotnet publish" for web app fails to complete when targeting "net46x" in VS 2017 RC
See original GitHub issueI’m running the latest .NET 1.1 SDK (1.0.0-preview5-004275) and tools, and am receiving an error when trying to run “dotnet publish” on a ASP.NET Core web application. It builds without errors, and if I change “net462” to “net452” it publishes fine. It also published fine when targeting net462 before the migration from the project.json format to the csproj format. I discovered the error when migrating my Service Fabric application from VS 2015 to VS 2017, but soon realized it applied to all Core web apps and am able to reproduce it using the below approach. I have a gist of a sample failing csproj file here as well.
Steps to reproduce
- In VS 2017, add a new ASP.NET Core Web Application (either Web API or Web Application is fine)
- Edit the associated .csproj file, and change
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>
to
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net462</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>
- Remove the
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />
entry from the PackageReference section. - Build the project
- Run dotnet publish.
Expected behavior
It publishes successfully.
Actual behavior
Receive the following error:
C:\Program Files\dotnet\sdk\1.0.0-preview5-004275\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Publish.targets(128,5): error MSB3094: "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 2 item(s). They must have the same number of items
Environment data
.NET Command Line Tools (1.0.0-preview5-004275)
Product Information:
Version: 1.0.0-preview5-004275
Commit SHA-1 hash: f1c16e59d6
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-preview5-004275
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (7 by maintainers)
Top GitHub Comments
We’re still experiencing the same issue with the latest VS 2017 RC with failing Copy task “DestinationFiles” refers to 1 item(s), and “SourceFiles” refers to 2 item(s). They must have the same number of items…
Ah, I’ve been looking a few different bugs. Mine is the same behavior but with packaging service fabric - not .net core - sorry