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.

netstandard and net461

See original GitHub issue

Steps 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
dazinatorcommented, Jun 20, 2017

Thank you, much appreciated. Will give it a shot.

Read more comments on GitHub >

github_iconTop 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 >

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