question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure with dotnet publish on preview tooling for MSBuild/csproj

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
colltoactioncommented, Nov 27, 2016

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!

1reaction
guardrexcommented, Nov 27, 2016

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. 🚑

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet publish command - .NET CLI
The dotnet publish command calls MSBuild, which invokes the Publish target. If the IsPublishable property is set to false for a particular ...
Read more >
MSBuild error when specifying PublishProfile for ASP.NET. ...
The error occurs when using a PublishProfile. The MSBuild command is: msbuild D:\project\project.csproj /p:DeployOnBuild=true /p:PublishProfile= ...
Read more >
Cannot debug net6.0-macos Apps - Developer Community
When I hit debug, the following error is shown in the Terminal: Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >
Part 2 - Caveats of project.json to MSBuild conversion
That bit about MSBuild tasks failing in dotnet publish and not in the Visual Studio 2017 IDE due to different base targets is...
Read more >
Msbuild not found. This is due to your VCTargetsPath path ...
Build failed with message Error: MSBuild tools not found. "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found