Paket
Paket copied to clipboard
Dotnet publish with PublishSingleFile=true fails after migrating project to paket
Description
Recently I migrated an F# project from managing dependencies via nuget to paket (using dotnet paket convert-from-nuget). It seems to have worked ok, the project built correctly and everything seemed fine until I tried to publish it as single file:
dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true
It failed with this output (shortened line prefixes):
error MSB4018: The "GenerateBundle" task failed unexpectedly. [C:\Users\haim\Code\Personal\roon-tagger\src\RoonTagger.Cli\RoonTagger.Cli.fsproj]
error MSB4018: System.ArgumentException: Invalid input specification: Found multiple entries with the same BundleRelativePath [C:\Users\haim\Code\Personal\roon-tagger\src\RoonTagger.Cli\RoonTagger.Cli.fsproj]
error MSB4018: at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs) [C:\Users\haim\Code\Personal\roon-tagger\src\RoonTagger.Cli\RoonTagger.Cli.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore() [C:\Users\haim\Code\Personal\roon-tagger\src\RoonTagger.Cli\RoonTagger.Cli.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [C:\Users\haim\Code\Personal\roon-tagger\src\RoonTagger.Cli\RoonTagger.Cli.fsproj]
error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\haim\Code\Personal\roon-tagger\src\RoonTagger.Cli\RoonTagger.Cli.fsproj]
error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\Users\haim\Code\Personal\roon-tagger\src\RoonTagger.Cli\RoonTagger.Cli.fsproj]
If I'm running the same command on the commit pre migration it builds correctly.
Repro steps
Please provide the steps required to reproduce the problem
(using .Net 5):
- Checkout branch
project-changesfrom this repository -
dotnet tool restore -
dotnet paket restore -
dotnet build - change directory to
src\RoonTagger.Cli -
dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true
This should produce the above error
If you try the same publish command on master it should build correctly.
Expected behavior
It should produce single executable :)
Actual behavior
The above mentioned error.
Thanks in advance
Haim