"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 issueSteps to reproduce
- Install .NET core sdk 3.0.100-preview6-012012
- 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
- run “dotnet build” to observe the result
##Note
- This issue also repro with VS
- 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
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:
- Created 4 years ago
- Comments:34 (17 by maintainers)
As a workaround, you can put the following in your .NET Core project which references .NET Standard 2.1:
You have to use the latest Visual Studio preview.