Sitelet https://github.com/fsprojects/Paket/issues/2852
Skip to content

Paket causes build warnings by adding references to NETStandard.Library #2852

Description

@yaakov-h

Description

When adding Paket to a project which either:

  • targets .NET Standard exclusively, or
  • multi-targets, and one of those targets is .NET Standard,

the project immediately gets two build warnings. In a strict environment, this fails the build.

Repro steps

Please provide the steps required to reproduce the problem

  1. Clone https://github.com/yaakov-h/PaketTargetFrameworkRepro
  2. Run dotnet restore
  3. Optionally, also run dotnet build.

Expected behavior

The build completes with zero warnings and zero errors.dotnet

Actual behavior

C:\Temp\PaketTargetFrameworkRepro>dotnet restore && dotnet build
C:\Program Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.DefaultItems.targets(199,5): warning : A PackageReference for 'NETStandard.Library' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [C:\Temp\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro.csproj]
C:\Program Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.DefaultItems.targets(199,5): warning : A PackageReference for 'NETStandard.Library' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [C:\Temp\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro.csproj]
  Restore completed in 16.34 ms for C:\Temp\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro.csproj.
C:\Program Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.DefaultItems.targets(199,5): warning : A PackageReference for 'NETStandard.Library' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [C:\Temp\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro.csproj]
C:\Program Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.DefaultItems.targets(199,5): warning : A PackageReference for 'NETStandard.Library' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [C:\Temp\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro.csproj]
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  PaketTargetFrameworkRepro -> C:\Temp\PaketTargetFrameworkRepro\PaketTargetFrameworkRepro\bin\Debug\netstandard1.3\PaketTargetFrameworkRepro.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.62

C:\Temp\PaketTargetFrameworkRepro>

Known workarounds

  1. Target net and/or netcoreapp explicitly instead of netstandard, or
  2. Add <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> to the project file.

Additional Information

.NET Command Line Tools (2.0.2)

Product Information:
 Version:            2.0.2
 Commit SHA-1 hash:  a04b4bf512

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.2\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions