netstandard and net461
See original GitHub issueSteps to reproduce
In my csproj, I am targeting netstandard 1.6
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Gluon.Core Class Library</Description>
<Authors>Darrell.Tunnell</Authors>
<TargetFramework>netstandard1.6</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Gluon.Core</AssemblyName>
<PackageId>Gluon.Core</PackageId>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<UpdateVersionProperties>true</UpdateVersionProperties>
</PropertyGroup>
I then have another project targeting net 461 that references the first netstandard1.6 project.
dotnet restore on the net 461 project then outputs this:
Project Gluon.Core is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Project Gluon.Core supports: netstandard1.6 (.NETStandard,Version=v1.6)
One or more projects are incompatible with .NETFramework,Version=v4.6.1 (win7-x86).
Yet from this table: https://docs.microsoft.com/en-gb/dotnet/standard/net-standard netstandard1.6 should be compatible with net461. What am I missing?
Expected behavior
targeting netstandard1.6 library from net461 project should be valid.
Actual behavior
Not valid.
Environment data
dotnet --info
output:
Product Information: Version: 1.0.4 Commit SHA-1 hash: af1e6684fd
Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.4 PS C:\Users\darrell.tunnell\Source\Repos\gluon\src>
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Reference .net461 assembly from netstandard 2.0
This feature works if you reference projects which use "old" .csproj format (and target .NET 4.6.1 or less), or it you reference library ......
Read more >Cross-platform targeting for .NET libraries
NET Standard lets you produce libraries that are constrained to use APIs that are in a given version of .NET Standard, which means...
Read more >NET Standard 2.0 vs. .NET Framework 4.6.1 · Issue #64
having net461 support netstandard2.0 therefore gets netstandard2.0 to wide availability years earlier. i think it would be worth the back-compat ...
Read more >net461 project is not compatible with .NET Standard 2.0
In package reference, the package dependencies are transitive, so NuGet has to attempt to find the closest matching compatible target framework.
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 >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
https://www.microsoft.com/net/core/preview#windowscmd.
Also, https://github.com/dotnet/cli/tree/release/2.0.0.
Thank you, much appreciated. Will give it a shot.