NetCore app 3.0 and NetStandard 2.1 compatibility issue

1.6k views Asked by At

I am referencing a class library project built for netstandard2.1 target by a netcoreapp3.0 project in my Jetbrains Rider IDE and getting a compatibility error. What I understood from .NET implementation support table in the official netstandard dedicated article (https://learn.microsoft.com/en-us/dotnet/standard/net-standard) is that they should be compatible. Is my understanding incorrect and is the concept of netstandard different from "standard for building .NET class libraries that should be compatible with both .NET Framework and .NET core"?

1

There are 1 answers

0
eduherminio On

You can definitely reference a .NET Standard 2.1 project from a .NET Core 3.0 project.

I'm not familiar with Rider, so bear with be, but let's try to see what's wrong:

  • Was the dependency added in the right direction? Do you have something like this in IntegrationTests.csproj, and not the opposite in the library project file?
  <ItemGroup>
    <ProjectReference Include="..\UnixUtils\UnixUtils.csproj" />
  </ItemGroup>
  • Do you face the same issue when building the .NET Core project from command line (dotnet build IntegrationTests.csproj)?

If the anwer to both questions is 'yes', I'm afraid we'll need to see the relevant parts of .csproj files to understand what's going on.