2

Consider the following script below. I'm not sure what it takes to get my app to compile using Paket and I'm sure it's something small I'm missing. Does anyone have any insight?

dotnet new console -n PaketApp -lang "F#" -o .
dotnet new tool-manifest
dotnet tool install paket
dotnet paket init
dotnet paket auto-restore on
dotnet paket add FParsec --project PaketApp

"open FParsec" > "Program.fs"

dotnet build

At the very least, I can get this script to compile the dotnet app, but I'm not really sure what convert-from-nuget is actually doing.

dotnet new console -n PaketApp -lang "F#" -o .
dotnet add package FParsec
dotnet new tool-manifest
dotnet tool install paket
dotnet paket convert-from-nuget

"open FParsec" > "Program.fs"

dotnet build

.NET sdks on my machine:

dotnet --list-sdks
3.1.100 [C:\Program Files\dotnet\sdk]
3.1.101 [C:\Program Files\dotnet\sdk]
3.1.200 [C:\Program Files\dotnet\sdk]
3.1.301 [C:\Program Files\dotnet\sdk]
3.1.402 [C:\Program Files\dotnet\sdk]
5.0.100 [C:\Program Files\dotnet\sdk]
5.0.101 [C:\Program Files\dotnet\sdk]
LockeGarmin
  • 195
  • 1
  • 1
  • 10

1 Answers1

2

When you ran the first snippet, paket.references file for your project is not created. You can create it manually and just put FParsec in it. Then run dotnet paket install and dotnet build to compile your application.

edit: also, target framework in paket.dependencies needs to be changed to framework: net5.0, by default it's framework: netcoreapp3.1, netstandard2.0, netstandard2.1. I don't see an option in paket init to set a different framework.

maciek
  • 521
  • 1
  • 4
  • 18
  • Hmm, you're correct it didn't add the `paket.references`, I tried following your suggestion and sadly the build still fails for me. I'm using the .NET 5 sdk in case that makes a difference. I'll make an edit to my script above so it includes that file and the fact that I'm using that specific SDK – LockeGarmin Dec 24 '20 at 19:19
  • C:\Users\Locke\Desktop\PaketApp\Program.fs(1,6): error FS0039: The namespace or module 'FParsec' is not defined. [C:\Users\Locke\Desktop\PaketApp\PaketApp.fsproj] – LockeGarmin Dec 25 '20 at 01:13
  • @LockeGarmin please see the edited answer. – maciek Dec 27 '20 at 23:24