sdk: NETSDK1073 for .NET Core 2.2 | Builds Fail
Preface
I am reporting this here based on this comment from a (possibly) related issue. _Originally posted by @dsplaisted in https://github.com/dotnet/cli/issues/11378#issuecomment-539583642_
@robborden Can you open a new issue for the failures you’re encountering? The error message is the same but I don’t believe the root cause is the same as this issue which has been fixed. Thanks!
This is from the dotnet/CLI repo but when you go to create a new issue there the text reads:
PLEASE DO NOT FILE ISSUES IN THIS REPO File them in https://github.com/dotnet/sdk instead.
If this is the wrong location let me know.
Problem Description
I am using Visual Studio 2019 version 16.3.8. I have a solution with these frameworks:
- Project1 targets netcoreapp2.2
- Project2 targets netstandard2.0
- Project3 targets netcoreapp2.2
- Project4 targets netcoreapp2.2
When I rebuilt the solution I am now getting an unexpected error from each project:
“The FrameworkReference ‘.NETStandard,Version=v2.0’ was not recognized” The file referenced is Microsoft.NET.Sdk.FrameworkReferenceResolution.Targets on line 236. This points to:
<ResolveTargetingPackAssets FrameworkReferences="@(FrameworkReference)"
ResolvedTargetingPacks="@(ResolvedTargetingPack)"
RuntimeFrameworks="@(RuntimeFramework)"
GenerateErrorForMissingTargetingPacks="$(GenerateErrorForMissingTargetingPacks)">
Trying this with dotnet build produces the same error:
λ dotnet build
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 819.77 ms for C:\Users\<my username>\dev\projects\<My Project>\MyNamespace.Models\MyNamespace.Models.csproj.
Restore completed in 7.7 sec for C:\Users\<my username>\dev\projects\<My Project>\MyNamespace.Endpoint\MyNamespace.Endpoint.csproj.
Restore completed in 7.81 sec for C:\Users\<my username>\dev\projects\<My Project>\MyNamespace.Tests\MyNamespace.Tests.csproj.
Restore completed in 12.02 sec for C:\Users\<my username>\dev\projects\<My Project>\MyNamespace.Proxy\MyNamespace.Proxy.csproj.
C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(263,5): error NETSDK1073: The FrameworkReference '.NETStandard,Version=v2.0' was not recognized [C:\Users\<my username>\dev\projects\<My Project>\MyNamespace.Models\MyNamespace.Models.csproj]
Build FAILED.
C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(263,5): error NETSDK1073: The FrameworkReference '.NETStandard,Version=v2.0' was not recognized [C:\Users\<my username>\dev\projects\<My Project>\MyNamespace.Models\MyNamespace.Models.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:23.39
Workaround
Open the project in Visual Studio 2017 and I am able to produce builds without error.
Expected behavior
The project would not report errors and could be built.
Environment Data
λ dotnet --info .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26
Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.0.100\
Host (useful for support): Version: 3.0.0 Commit: 7d57652f33
.NET Core SDKs installed: 2.1.402 [C:\Program Files\dotnet\sdk] 2.1.502 [C:\Program Files\dotnet\sdk] 2.1.801 [C:\Program Files\dotnet\sdk] 2.1.802 [C:\Program Files\dotnet\sdk] 2.2.105 [C:\Program Files\dotnet\sdk] 2.2.401 [C:\Program Files\dotnet\sdk] 2.2.402 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (9 by maintainers)
Commits related to this issue
- Update dependencies from https://github.com/dotnet/sdk build 20191217.15 (#3873) - Microsoft.NET.Sdk - 3.1.200-preview.19617.15 — committed to dotnet/sdk by dotnet-maestro[bot] 5 years ago
Delete all the frameworkReferences from the .nuspec:
If you’ve done this and are still getting the error, make sure to bump the package version so you’re sure you’re not getting an older version, and you can open up the .nupkg in NuGet Package Explorer to ensure that the frameworkReferences aren’t still in the package.