Paket install does not do a dotnet restore and does not notify Ionide

Created on 21 May 2019  路  12Comments  路  Source: fsprojects/Paket

When you call paket install, I would expect dotnet restore to be implicitly called, but it is not - you have to explicitly call dotnet restore in order to get installed projects to show up. Using paket global tool version 5.207.0.

Steps to reproduce

  1. Create an empty F# console application.
  2. Convert it to paket
  3. Add Saturn to the dependencies file.
  4. Add a paket references file and add Saturn as well.
  5. Run paket install.
  6. Try to open the Saturn namespace. Observe that the compiler does not recognise it in e.g. Ionide.
  7. Run dotnet restore.
  8. Observe that the namespace is now available.

Sample dependencies file

source https://www.nuget.org/api/v2
storage: none

nuget Saturn

All 12 comments

yeah I think the question is: Do we want to call dotnet restore automatically at the end of paket install or paket restore. I would probably make things easier for IDEs /cc @matthid

@forki would this lead to some kind of infinite loop - dotnet restore also calls paket restore doesn't it?

well, in theory the new spawned paket just sees that everything is up-to-date and will exit early.

We can try but lots of questions arise and it is dangerous territory.

  • what if no dotnet sdk is installed?
  • where do we search?
  • what if loops exist? -> very much possible when we cannot detect all target frameworks with our heuristic, for example if people use build.props or other msbuild tricks
  • should we fail if dotnet fails?

I think we would just try to call it and not fail. This would be just convenience for IDEs

one question is why Ionide doesn't call dotnet restore after 5) automatically. cc @Krzysztof-Cieslak any ideas?

OK I think I found the reason. It doesn't nukes the project.assets.json - which means Ionide can't know that it needs to restore again

On a clean project there won't be a project.assets.json though

can you please update the text with when you open ionide in the process

On a clean project there won't be a project.assets.json though

dotnet new is calling dotnet restore. So yes you have that file hanging around

Didn't even realise that :-)

@forki thanks that's great.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alfonsogarciacaro picture alfonsogarciacaro  路  4Comments

haraldsteinlechner picture haraldsteinlechner  路  4Comments

alfonsogarciacaro picture alfonsogarciacaro  路  8Comments

haf picture haf  路  7Comments

pshrosbree picture pshrosbree  路  3Comments