FSharpLint icon indicating copy to clipboard operation
FSharpLint copied to clipboard

.NET tool is net5

Open nojaf opened this issue 4 years ago • 6 comments

Description

Hello, I'm wondering if there is a strict limitation of using net5 for the dotnet tool. As we are still on netcoreapp3.1 we can't install the tool.

Repro steps

Please provide the steps required to reproduce the problem

dotnet tool install dotnet-fsharplint

global.json:

{
  "sdk": {
    "version": "3.1.402",
    "rollForward": "latestMinor"
  }
}

Expected behavior

Well, I was hoping we could use the tool.

Actual behavior

error NU1202: Package dotnet-fsharplint 0.19.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1) / any. Package dotnet-fsharplint 0.19.0 supports: net5.0 (.NETCoreApp,Version=v5.0) / any
The tool package could not be restored.
Tool 'dotnet-fsharplint' failed to install. This failure may have been caused by:

Known workarounds

What you can do in these kinds of situation is target 3.1 and add the <RollForward>Major</RollForward> property in your fsproj. (example). That way you can support the current LTS but people on newer SDKs can also just use it.

But, maybe this is all very much by design and I'm missing something.

Related information

  • Operating system Win 10
  • .NET Runtime, CoreCLR or Mono Version : .NETCore 3.1

nojaf avatar Jun 17 '21 07:06 nojaf

Hi @nojaf this isn't intended as you suspected, thanks for bringing it up. It should only be impacting the most recent version that went out last week, looks like a dependency upstream is stuck on net5 at the moment too, so I'll look at trying to get that across so we can get support for 3.1.x back

duckmatt avatar Jun 21 '21 21:06 duckmatt

Is this still an issue? (Things are hopefully moving towards .NET 6 now, and I don't imagine it would want to go back to 3.1 at this point)

Numpsy avatar Dec 06 '23 19:12 Numpsy

@Numpsy we're moving to .NET6 indeed, but if @nojaf's bug report means that by migrating from .NET5 to .NET6, fsharplint cannot analyze .NET5 projects anymore, then we need to look into it. We should be backwards compatible.

knocte avatar Dec 07 '23 03:12 knocte

That is not what the original report was about. There is a difference between being able to install the tool with your current SDK and the tool being about to analyze your project. I would expect that if you move to net6.0, the user will still be able to analyze net5.0 projects, but needs to use the 6 SDK.

nojaf avatar Dec 07 '23 07:12 nojaf

if you move to net6.0, the user will still be able to analyze net5.0 projects, but needs to use the 6 SDK

There is a test project file at

https://github.com/fsprojects/FSharpLint/blob/master/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.NetCore/FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj

built as .net core 3.1 which is just used by the tests (not attached to the main build) that I think should test that the .net 5/6/+ build of the tool will analyze a .net core 3.1 project, which would be testing that sort of case.

Anyway, my initial comment was mainly refering to the we can get support for 3.1.x back comment above, as I think it's past that point now.

Numpsy avatar Dec 08 '23 11:12 Numpsy