SaturnFramework / Saturn

Opinionated, web development framework for F# which implements the server-side, functional MVC pattern
https://saturnframework.org
MIT License
708 stars 108 forks source link

Issues with netcore3.0/1 clean project #216

Closed isaacabraham closed 4 years ago

isaacabraham commented 4 years ago

There are some incompatibilities with Paket, Saturn and combinations of netcore30 and 31.

Defaults

  1. Create a new console app with netcore31 sdk (LTS) e.g. dotnet new console -lang f#.
  2. Create a new paket file using paket init.
  3. Add Saturn e.g. paket add saturn -p myapp.
  4. Start the app dotnet run.

You get the following error:

Unhandled exception.
   Cannot print exception string because Exception.ToString() failed.

2. Try downgrading the project

  1. Amend myapp.fsproj to netcore30
    <TargetFramework>netcoreapp3.0</TargetFramework>
  1. paket install
  2. dotnet run
error NU1202: Package Microsoft.AspNetCore.Authentication.JwtBearer 3.1.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.AspNetCore.Authentication.JwtBearer 3.1.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)

The build failed. Fix the build errors and run again.

You can fix it by upgrading the paket file to netcore31 instead of downgrading the project. However, the default combinations don't work.

tagging @forki @baronfel @Krzysztof-Cieslak

forki commented 4 years ago

It should be fixed by making Paket emit Netcoreapp3.1

Isaac Abraham notifications@github.com schrieb am So., 2. Feb. 2020, 16:41:

There are some incompatibilities with Paket, Saturn and combinations of netcore30 and 31. Defaults

  1. Create a new console app with netcore31 sdk (LTS) e.g. dotnet new console -lang f#.
  2. Create a new paket file using paket init.
  3. Add Saturn e.g. paket add saturn -p myapp.
  4. Start the app dotnet run.

You get the following error:

Unhandled exception. Cannot print exception string because Exception.ToString() failed.

  1. Try downgrading the project

    1. Amend myapp.fsproj to netcore30
    netcoreapp3.0
    1. paket install
    2. dotnet run

error NU1202: Package Microsoft.AspNetCore.Authentication.JwtBearer 3.1.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.AspNetCore.Authentication.JwtBearer 3.1.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)

The build failed. Fix the build errors and run again.

You can fix it by upgrading the paket file to netcore31 instead of downgrading the project. However, the default combinations don't work.

tagging @forki https://github.com/forki @baronfel https://github.com/baronfel @Krzysztof-Cieslak https://github.com/Krzysztof-Cieslak

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SaturnFramework/Saturn/issues/216?email_source=notifications&email_token=AAAOANCH53NAEYIU465MSLTRA3SQ7A5CNFSM4KO2LOK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IKNJUVQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOANFLCT7EAGLLTQM4BETRA3SQ7ANCNFSM4KO2LOKQ .

baronfel commented 4 years ago

So this is just the paket init default file specifying a TFM of netcoreapp3.1? Can that be worked around by making paket assume framework: auto?

isaacabraham commented 4 years ago

I'll submit a PR to update Paket, although I don't fully understand what these errors are caused by. It's so confusing.

isaacabraham commented 4 years ago

I've created a basic PR, this'll be fixed next week.

isaacabraham commented 4 years ago

This is fixed in the latest Paket.