Search code examples
visual-studio-codef#f#-fakeionide

Fix for "Package manager key paket was not registered" in build.fsx


When I open a Fake build script in Visual Studio Code, like this:

> dotnet new -i fake-template
> dotnet new fake
> dotnet tool update fake-cli
> code build.fsx

I see this error message in the editor and none of the Fake namespaces, modules, or types are defined:

Package manager key 'paket' was not registered in
c:\Users\wallace.kelly\.vscode\extensions\ionide.ionide-fsharp-5.4.0\bin\
Currently registered: nuget

How do I correct this error?

Running dotnet fake build works fine. The error just appears in the editor.

I have "FSharp.dotNetRoot": "C:\\Program Files\\dotnet\\sdk", in my Settings file. That folder includes folders 2.1.701 2.2.401 3.1.407 5.0.103 and 5.0.104.


Solution

  • maintainer of Ionide for VS Code here. That's error's just going to happen from here on out. FAKE is behind in its versions of the FSharp.Compiler.Services, and without updates to that component the integration we have with FAKE has atrophied to the point where the editor shows errors in that script.

    There are a few solutions:

    • continue to use FAKE and just deal with editor issues
    • stop using FAKE as the script runner, but continue to use FAKE libraries from a build project or 'standard' fsx script
    • use another build system of some kind
    • contribute updates to FAKE (and by extension the deprecated code in Ionide)

    etc etc.