Issues with Resharper Tool

Issue Description

I been working on a fork of thrive to eventaually get pulled into the main branch and i was trying to use the check_formatting.rb tool to make sure everything is right but when i run it i get an error when it tries to restore the dotnet tool because it not compatible net60 and only supported netcoreapp3.1, i did install .net 6.0 for a unrelated project but i am not sure how to get the tool use the right version as i did intall .net core 3.1 but that still did not help.

Your code

I don’t think it’s relevant

Extra error information

Actual Error Message:
Restoring dotnet tools to make sure they are up to date
\AppData\Local\Temp\l23mktj3.mch\restore.csproj : error NU1202: Package JetBrains.ReSharper.GlobalTools 2021.3.1 is not compatible with net60 (.NETFramework,Version=v6.0) / any. Package JetBrains.ReSharper.GlobalTools 2021.3.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1) / any

Package "jetbrains.resharper.globaltools" failed to restore, due to Microsoft.DotNet.ToolPackage.ToolPackageException: The tool package could not be restored.
   at Microsoft.DotNet.Tools.Tool.Install.ProjectRestorer.Restore(FilePath project, PackageLocation packageLocation, String verbosity)
   at Microsoft.DotNet.ToolPackage.ToolPackageInstaller.InstallPackageToExternalManagedLocation(PackageLocation packageLocation, PackageId packageId, VersionRange versionRange, String targetFramework, String verbosity)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.InstallPackages(ToolManifestPackage package, Nullable`1 configFile)

Restore failed.

ERROR: Running command failed (if you try running this manually you need to make sure that all the comma separated parts are quoted if they aren't whole words): dotnet, tool, restore
Stack trace for error:
/RubySetupSystem/RubyCommon.rb:240:in `runOpen3Checked'
/check_formatting.rb:233:in `block in install_dotnet_tools'
/check_formatting.rb:224:in `synchronize'
/check_formatting.rb:224:in `install_dotnet_tools'
/check_formatting.rb:732:in `run_inspect_code'
/check_formatting.rb:954:in `block in <main>'
/check_formatting.rb:972:in `block (2 levels) in <main>'

Are the SDKs properly installed?

I get the following:

$ dotnet --list-sdks
3.1.118 [/usr/lib64/dotnet/sdk]
5.0.206 [/usr/lib64/dotnet/sdk]
6.0.100 [/usr/lib64/dotnet/sdk]

Also just having sdk version 5 should be enough (at least on Linux) as the CI containers manage to install the tools just fine with only that version installed.

Yeah it looks like it is:

2.1.202 [C:\Program Files\dotnet\sdk]
2.1.504 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.516 [C:\Program Files\dotnet\sdk]
3.1.402 [C:\Program Files\dotnet\sdk]
3.1.416 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]

It looks like you don’t have version 5, which might be the exactly needed one.

I just installed it and it still gives the same error

2.1.202 [C:\Program Files\dotnet\sdk]
2.1.504 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.516 [C:\Program Files\dotnet\sdk]
3.1.402 [C:\Program Files\dotnet\sdk]
3.1.416 [C:\Program Files\dotnet\sdk]
5.0.404 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]
error NU1202: Package JetBrains.ReSharper.GlobalTools 2021.3.1 is not compatible with net60 (.NETFramework,Version=v6.0) / any. Package JetBrains.ReSharper.GlobalTools 2021.3.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1) / any

Well all I know is that the command listed here: NuGet Gallery | JetBrains.ReSharper.GlobalTools 2021.3.2 should work and that jetbrains has some documentation of their own about installing the tools here: ReSharper command line tools | ReSharper

I was eventually able to figure it out by creating a global.json file with the following content:

{
  "sdk": {
    "version": "3.1.100",
    "rollForward": "latestFeature"
  }
}
1 Like

In the Thrive folder or somewhere else?
I guess that file configures which .NET version to use when running the dotnet command?

Yeah that what it does, i just made it in the thrive root folder

it works with the ‘check_formatting.rb’ tool too

Should we then consider putting that kind of file in the main repo? Or perhaps we should wait and see if other people have the same issue.