question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"dotnet build" failed with error NETSDK1073 for the .NET core 3.0 app with reference to a .NET Standard 2.1 class lib

See original GitHub issue

Steps to reproduce

  1. Install .NET core sdk 3.0.100-preview6-012012
  2. Create a .NET core 3.0 app with reference to a .NET Standard 2.1 class lib with below CLI dotnet new console -o consoleapp30 dotnet new classlib -n CSNS21Lib -f netstandard2.1 dotnet add reference …\CSNS21Lib\CSNS21Lib.csproj
  3. run “dotnet build” to observe the result

##Note

  1. This issue also repro with VS
  2. This issue is not repro on the .NET core 3.0 app with reference to a .NET Standard 2.0 class lib

Expected behavior

The project can be built successfully

Actual behavior

Build with error NETSDK1073: The FrameworkReference ‘NETStandard.Library’ was not recognized image

Environment data

dotnet --info output: .NET Core SDK (reflecting any global.json): Version: 3.0.100-preview6-012012 Commit: 94b54a5ef6

Runtime Environment:
OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview6-012012\

Host (useful for support): Version: 3.0.0-preview6-27718-08 Commit: 7c7a2e9074

.NET Core SDKs installed: 2.1.800-preview-009677 [C:\Program Files\dotnet\sdk] 2.2.400-preview-010195 [C:\Program Files\dotnet\sdk] 3.0.100-preview6-012012 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0-preview6-19265-03 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0-preview6-27718-08 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0-preview6-27718-08 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:34 (17 by maintainers)

github_iconTop GitHub Comments

35reactions
dsplaistedcommented, Jun 7, 2019

As a workaround, you can put the following in your .NET Core project which references .NET Standard 2.1:

  <Target Name="WorkaroundNetStandard" AfterTargets="ResolvePackageAssets">
    <ItemGroup>
      <TransitiveFrameworkReference Remove="NETStandard.Library" />
    </ItemGroup>
  </Target>
2reactions
Fabicommented, Jun 14, 2019

This is working using the latest VS build and the latest preview6 CLI.

@livarcocc - Specifically which versions? I still get this error with the following versions:

NetCoreApp3.0: preview6-27804-01 Visual Studio: 16.1.3

You have to use the latest Visual Studio preview.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The current .NET SDK does not support targeting . ...
NET Standard 2.0 error in Visual Studio 2017 update 15.3. I want to create a class library project with Target Framework . NET...
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >
Converting a .NET Standard 2.0 library to .NET Core 3.0
NET Standard 2.0 class libraries to .NET Core 3.0. I'm specifically looking at converting libraries in this post.
Read more >
The Current .NET SDK does not support targeting . ...
How to work around a common .NET Core compilation targeting error using .NET Core 3 SDK and .NET Core 3 projects with Visual...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found