sdk: Failure with dotnet publish on preview tooling for MSBuild/csproj

Steps to reproduce

Using 1.0.0-preview4-004079

  1. Execute dotnet migrate to migrate project.json-based Core project to MSBuild/.csproj project
  2. Execute dotnet publish --configuration Release --runtime win10-x64

See resultant .csproj file here: https://gist.github.com/GuardRex/58bb9e17a9b372c7bfcd3f79043365ab

Expected behavior

Successful publish of project. [Note: dotnet build works for the migrated project.]

Actual behavior

Build fails with an error …

_CopyResolvedFilesToPublishPreserveNewest:
Building target "_CopyResolvedFilesToPublishPreserveNewest" partially, because some output 
files are out of date with respect to their input files.
1>C:\Users\<USER>\.nuget\packages\microsoft.net.sdk\1.0.0-alpha-20161104-2\build\
     Microsoft.NET.Publish.targets(98,5): error MSB3094: "DestinationFiles" refers to 1 item(s), 
     and "SourceFiles" refers to 2 item(s). They must have the same number of items. 
     [<PATH>\testselfcontained\testselfcontained.csproj]
1>Done Building Project "<PATH>\testselfcontained\testselfcontained.csproj" (Publish target(s)) 
     -- FAILED.

Environment data

.NET Command Line Tools (1.0.0-preview4-004079)

Product Information:
 Version:            1.0.0-preview4-004079
 Commit SHA-1 hash:  43dfa6b8ba

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

It built now! I think the issue was I had web.config in the <Content> tag, and it was overlapping with the one on Microsoft.NET.Sdk.Web.

Thanks a lot!

If you know you have the 1.1 SDK from https://www.microsoft.com/net/download/core and you have 1.0.0-preview3-004056 tooling from https://github.com/dotnet/core/blob/master/release-notes/preview3-download.md, check out the notes from @vijayrkn in https://github.com/aspnet/IISIntegration/pull/299. He got me patched up. 🚑