Refit: [BUG] Can't Build .NetStandar 2.1 Project with Refit v6

Created on 1 Mar 2021  路  2Comments  路  Source: reactiveui/refit

Describe the bug
I faced a couple of problems with System.IO.IOException: Unable to read data from the transport and found comments that it was fixed at Refit v6.

But when I upgrade from 5.2.4 to any v6 I've got this:

image

Environment

  • IDE: Rider 2020.3.3 (latest) and VS for Mac also latest from Stable
  • Version: Refit v6.* for example latest 6.0.24
  • Working Version: Refit 5.2.4

What should I do to resolve this issue? Help me pls...

bug

Most helpful comment

So I was able to recreate the same issue. The issue arises when you are using the .NET 3.1 SDK and targeting .NET Standard 2.1.

The fix is to install the .NET 5 SDK and add a global JSON.

{
  "sdk": {
    "version": "5.0.100",
    "rollForward": "Minor"
  }
}

This will make sure that Rider (and other IDEs) pick up the right build tools.

All 2 comments

You need to contact JetBrains, sorry. It looks like the MSBuild they're using is too old and doesn't contain support for Source Generators.

So I was able to recreate the same issue. The issue arises when you are using the .NET 3.1 SDK and targeting .NET Standard 2.1.

The fix is to install the .NET 5 SDK and add a global JSON.

{
  "sdk": {
    "version": "5.0.100",
    "rollForward": "Minor"
  }
}

This will make sure that Rider (and other IDEs) pick up the right build tools.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiraldesai picture hiraldesai  路  4Comments

Mike-E-angelo picture Mike-E-angelo  路  6Comments

sahinyyurt picture sahinyyurt  路  5Comments

ColKrumpler picture ColKrumpler  路  3Comments

ML13 picture ML13  路  4Comments