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.

$(PaketRootPath) is not set on a fresh dotnet restore

See original GitHub issue

Description

On a fresh restore of a Fable template, the paket restore fails due to an unset path variable.

I initially thought the problem was in (mono’s version of) MSBuild, since apparently $(PaketRootPath) is set as $(MSBuildThisFileDirectory).

However, once I went and manually replaced $(PaketRootPath) with $(MSBuildThisFileDirectory) in Paket.Restore.Targets the problem went away because $(MSBuildThisFileDirectory) was set correctly, so I guess the issue may be on the Paket side?

Repro steps

On Ubuntu 17.04 with the dotnet 2.0 Preview 2 installed, run this:

dotnet new -i Fable.Template.Simple dotnet new fable -n fsimple dotnet restore

Expected behavior

The restore process starts (and then hangs due to an unrelated bug 😃 )

Actual behavior

The restore process exits immediately with:

  Cannot open assembly '': No such file or directory.
/home/piaste/Projects/fsimple/.paket/Paket.Restore.targets(18,5): error MSB3073: The command "mono --runtime=v4.0.30319 "" restore --project "/home/piaste/Projects/fsimple/src/fsimple.fsproj" --target-framework netstandard1.6" exited with code 2. [/home/piaste/
Projects/fsimple/src/fsimple.fsproj]

The argument which comes up empty after --runtime is $(PaketExePath), which is defined as follows:

<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>

Known workarounds

As mentioned above, manually replacing $(PaketRootPath) with $(MSBuildThisFileDirectory) in Paket.Restore.Targets fixes the problem.

Environment

Paket version 5.6.11

dotnet --info:

.NET Command Line Tools (2.0.0-preview2-006497)

Product Information: Version: 2.0.0-preview2-006497 Commit SHA-1 hash: 06a2093335

Runtime Environment: OS Name: ubuntu OS Version: 17.04 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.0.0-preview2-006497/

Microsoft .NET Core Shared Framework Host

Version : 2.0.0-preview2-25407-01 Build : 40c565230930ead58a50719c0ec799df77bddee9

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
forkicommented, Jul 14, 2017

If you find some time… Would be nice 😉

Am 14.07.2017 19:05 schrieb “Maxime Mangel” notifications@github.com:

@forki https://github.com/forki I fixed the elmish templates. But perhaps not the fable.Simple

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket/issues/2519#issuecomment-315412575, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNNn40mELx5amNe5iyIlMYkM7JKu-ks5sN5_AgaJpZM4OYBza .

0reactions
MangelMaximecommented, Jul 14, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >
dotnet restore not updating to new version when using * ...
Run dotnet restore; Watch the new package version be downloaded; Edit the project file, reverting the 1.6.10 back to 1.6.*.
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
This error occurs when you attempt to build a project that contains references to one or more NuGet packages, but those packages are...
Read more >
Publish ReadyToRun with --no-restore requires changes
Learn about the breaking change in .NET 6 where publishing a project with ReadyToRun requires changes to the way the project is restored....
Read more >
dotnet restore not restoring nuget packages - Thiago Passos
Any time I ran the command dotnet build locally it would just work while running the same in the build server was failing....
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