fsprojects / fsprojects/Paket

dotnet paket convert-from-nuget doesn't respect target framework version when creating paket.lock

Open
#4,189 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

Please provide a succinct description of your issue.

Repro steps
Fastest way to reproduce
  1. In vs-code install Dev Containers
  2. Create the following folders hierarchy
    bugfix-issue-id/.devcontainer/
  3. Create the following two files in the .devcontainer folder
    • bolero.Dockerfile
    • devcontainer.json
  4. Content for the bolero.Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS dev-env
WORKDIR /src
RUN dotnet new -i Bolero.Templates
  1. Content for the devcontainer.json
{
    "name": "tahh-bolero",
    "dockerFile": "bolero.Dockerfile",
    "customizations": {
        "vscode": {
            "extensions": [
                "Ionide.Ionide-fsharp",
                "ms-dotnettools.dotnet-interactive-vscode"
            ]
        }
    }
}
  1. Run the dev container
  2. In the terminal scaffold a blazor project: $ dotnet new blazorwasm -o src/Frontend
  3. Test the project will build and function: $ run --project src/Frontend/Frontend.csproj
  4. Prepare for converting to paket
  5. $ dotnet new tool-manifest
  6. $ dotnet tool install paket
  7. $ dotnet paket convert-from-nuget
Expected behavior

Perfect build and compiling code

Actual behavior

The code will no longer build

/workspaces/blazorFakePaketZero/src/Frontend/Frontend.csproj : error NU1202: Package Microsoft.JSInterop.WebAssembly 7.0.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.JSInterop.WebAssembly 7.0.1 supports: net7.0 (.NETCoreApp,Version=v7.0)
/workspaces/blazorFakePaketZero/src/Frontend/Frontend.csproj : error NU1202: Package Microsoft.AspNetCore.Components.Web 7.0.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.AspNetCore.Components.Web 7.0.1 supports: net7.0 (.NETCoreApp,Version=v7.0)
/workspaces/blazorFakePaketZero/src/Frontend/Frontend.csproj : error NU1202: Package Microsoft.JSInterop.WebAssembly 7.0.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0) / browser-wasm. Package Microsoft.JSInterop.WebAssembly 7.0.1 supports: net7.0 (.NETCoreApp,Version=v7.0)
/workspaces/blazorFakePaketZero/src/Frontend/Frontend.csproj : error NU1202: Package Microsoft.AspNetCore.Components.Web 7.0.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0) / browser-wasm. Package Microsoft.AspNetCore.Components.Web 7.0.1 supports: net7.0 (.NETCoreApp,Version=v7.0)
Known workarounds

I know none
bugfix-issue-id.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dotnet paket convert-from-nuget entry point and inspect how it creates paket.lock from the Frontend.csproj. Reproduce with the provided .NET 6 Blazor project, then verify that the generated lock file respects net6.0 and the project builds without NU1202 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.