`dotnet restore` does not work on Linux when installed as global tool
See original GitHub issueDescription
Paket version: 5.219.6 Last Paket version without this issue: 5.219.5
dotnet restore
fails on Linux with the following message when paket is installed using dotnet tool install -g paket
The issue seems to be the following line in Paket.Restore.targets
:
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '' ">dotnet "$(PaketExePath)"</PaketCommand>
Repro steps
Please provide the steps required to reproduce the problem
- Install paket:
dotnet tool install -g paket
- Run
paket install
. - Run
dotnet restore
.
GitHub Repository with Travis CI setup: https://github.com/bash/paket-issue-3671
Expected behavior
No error.
Actual behavior
No executable found matching command "dotnet-paket"
/home/travis/build/bash/paket-bug/.paket/Paket.Restore.targets(139,5): error MSB3073: The command "dotnet "paket" restore" exited with code 1. [/home/travis/build/bash/paket-issue-3671/PaketBug/PaketBug.csproj]
The command "dotnet restore" exited with 1.
Known workarounds
Installing an older version of paket:
dotnet tool install -g paket --version 5.219.5
Issue Analytics
- State:
- Created 4 years ago
- Comments:37 (36 by maintainers)
Top Results From Across the Web
Troubleshoot .NET tool usage issues
You might come across issues when trying to install or run a .NET tool, which can be a global tool or a local...
Read more >dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >Run dotnet tool restore to make the dotnet-ef command ...
I found 2 ways. try to run visual studio as administrator. if (1.) does not work, in the project enter dotnet new tool-manifest...
Read more >"dotnet restore --interactive" doesn't work with Azure Artifacts
I have downloaded the Azure Artifacts Credential Provider by running a powershell command (Invoke-WebRequest...) and installed it - what seems - ...
Read more >.NET Core Global Tools and Gotchas
A .NET Core global tool is a special NuGet package that contains a console application ... There is no uninstall after dotnet install...
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
@atlemann Okay you’re right I prematurely declared victory before. I think I’ve actually got it this time, although it’s kind of horrible (but let’s be honest, anything having to do with MSBuild is horrible).
Add this target at the top:
This target will be responsible for creating the
PaketCommand
property, which is used in two other targets,PaketRestore
andPaketOverrideNuspec
. Unfortunately it looks like you can’t have properties depend on targets/tasks, so I think this is the only way to do it.Then to make sure
PaketCommand
is set beforePaketRestore
andPaketOverrideNuspec
are called, you need to update theDependsOnTargets
property for each of them. Top lines of those targets should look something like this:PaketRestore:
PaketOverrideNuspec:
I added one yesterday