Restore failing for projects with tfms netcoreapp3.0;netcoreapp3.0-Windows
See original GitHub issue<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;netcoreapp3.1-Windows</TargetFrameworks>
</PropertyGroup>
</Project>
fails during restore while
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net5.0;net5.0-Windows</TargetFrameworks>
</PropertyGroup>
</Project>
builds fine
The error in the first case
Build FAILED.
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\NuGet.targets(130,5): error : Invalid restore input. Duplicate frameworks found: 'netcoreapp3.1, netcoreapp3.1'. Input files: C:\git\scratch\rc2\rc2.csproj. [C:\git\scratch\rc2\rc2.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.68
is this by design ?
cc @ericstj
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Dotnet restore fails when providing runtime identifier due to ...
It works when I use netcoreapp2.1 as a target framework, but it breaks with netcoreapp3.1 or net5.0 . It also works when I...
Read more >Select which .NET version to use
Learn how .NET automatically finds and chooses runtime versions for your program. Additionally, this article teaches you how to force a ...
Read more >Please stop lying about .NET Standard 2.0 support!
In this post I have a bit of a rant about Microsoft's NuGet packages lying about supporting .NET Standard 2.0 when they kinda...
Read more >Bring Your .NET Apps Forward with the .NET Upgrade ...
After applying this step, you can see that the <TargetFramework> property of the project file has been updated to net6.0 (representing .NET 6.0...
Read more >Publishing a dotnetcore3.1 app results in an error ...
I am trying to publish my web app (targetframework is netcoreapp3.1) with server side blazor (3.2.0-preview1.20073.1) and am getting “Assets file ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That was the whole TargetFramework as alias problem. NuGet and the SDK both were parsing the TargetFramework element but it wasn’t supposed to be. To enable .NET 5 TFMs, NuGet & SDK switched to combining
TargetFrameworkMoniker
&TargetPlatformMoniker
to infer the true pivot framework.Now to preserve the consistent behavior for customers (ie simple project files), the TargetFramework property is parsed if
TargetPlatformMoniker
andTargetFrameworkMoniker
are not set. That’s being done in the SDK. As far as NuGet & SDK go, there’s no such thing as a platform specific .NETCoreApp 3.x, so the SDK ends up generating the same TargetFrameworkMoniker + TargetPlatformMoniker.Hope this clarifies the current behavior.
Let me know if we need to have a better error message (if it is possible at all). Then reopen the issue