Failure with dotnet publish on preview tooling for MSBuild/csproj
See original GitHub issueSteps to reproduce
Using 1.0.0-preview4-004079
…
- Execute
dotnet migrate
to migrateproject.json
-based Core project to MSBuild/.csproj
project - 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:
- Created 7 years ago
- Comments:16 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It built now! I think the issue was I had
web.config
in the<Content>
tag, and it was overlapping with the one onMicrosoft.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. 🚑