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.

Pack without explicit NETStandard.Library dependency

See original GitHub issue

Repro steps:

  1. New project:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard1.3</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <Version>0.1.0-dev</Version>
    <Authors>Author</Authors>
    <Description>Descriptor</Description>
    <NeutralLanguage>en</NeutralLanguage>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.3.1" PrivateAssets="none"/>
    <PackageReference Update="NETStandard.Library" PrivateAssets="all" />
  </ItemGroup>
</Project>
  1. Build in VS
  2. Inspect package:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    <id>PackRepro</id>
    <version>0.1.0-dev</version>
    <authors>Author</authors>
    <owners>Author</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <license type="expression">MIT</license>
    <description>Descriptor</description>
    <dependencies>
      <group targetFramework=".NETStandard1.3">
        <dependency id="Microsoft.CodeAnalysis.CSharp" version="2.3.1" exclude="Build,Analyzers" />
        <dependency id="NETStandard.Library" version="1.6.1" exclude="Build,Analyzers" />
      </group>
    </dependencies>
  </metadata>
</package>

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jnm2commented, Jul 30, 2019

<PackageReference Update="NETStandard.Library" PrivateAssets="all" /> was what I asked about in https://github.com/dotnet/standard/issues/601 for .NET Standard 1.x projects in order to forgo supporting VS2015-no-build-extensions and suppress the <dependency> element.

I remember it working at one point.

0reactions
dsplaistedcommented, Aug 6, 2019

I’m not able to repro this with preview 8 (3.0.100-preview8-013651). The implicit PackageReferences for NETStandard.Library and Microsoft.NETCore.App are still added during evaluation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting the right dependency version when using a .NET ...
Project X has a dependency on an external nuget package "ENP" which has different versions for netstandard and netframework.
Read more >
Dependencies and .NET libraries
The primary way of adding dependencies to a .NET library is referencing NuGet packages. NuGet package references allow you to quickly reuse ...
Read more >
Managing Dependencies in .NET: .csproj, .packages.config ...
Get an overview of the artifacts involved in .NET dependency management, how they interact, and how to use them.
Read more >
Using .NET Standard with Full Framework .NET - Rick Strahl
NET Framework that is fully .NET Standard 2.0 compliant without any additional dependencies. First Version to support .NET Standard 2.0 is 4.6.1.
Read more >
The paket.dependencies file
The paket.dependencies file is used to specify rules regarding your application's dependencies. It contains top level dependencies from all projects in the ...
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