Paket 5.x references NETStandard.Library twice

Created on 19 Jun 2017  路  16Comments  路  Source: fsprojects/Paket

Description

While testing it I tried: Paket 5.1.0, 5.1.3, 5.1.4, 5.1.5 and 5.1.6

When using Paket 5.x it references NETStandard.Library twice (kind of).

Repro steps

mkdir solution && cd solution && dotnet new sln
curl -L -o paket.cmd http://bit.ly/2ooaInt
paket init
echo framework: netcoreapp1.1 >> paket.dependencies
echo nuget Grpc >> paket.dependencies
mkdir project && cd project && dotnet new classlib --framework netstandard1.6 && cd ..
dotnet sln solution.sln add project\project.csproj
echo Grpc > project\paket.references
paket install && dotnet restore

Now open this solution with Visual Studio, and:

  • Unfold "Dependencies", "Nuget" and "SDK". "NETStandard.Library" is in both, but in "Nuget" has yellow warning triangle;
  • All dependencies of NETStandard.Library as also referenced twice (from "Nuget" and "SDK");
  • Visual Studio show warning on "Error List" tab: 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

Expected behavior

  • Only "Grpc" in "Nuget" dependencies ("NETStandard.Library" should be in SDK). This is also how Paket 4.8.8 behaves.

Actual behavior

Dependecies are referenced twice.

Known workarounds

Use Paket 4.8.8.

bug dotnesdk

All 16 comments

can you please upload a zip before the step where things go wrong?

Oops, missed that:
build.zip - Windows batch file
solution.zip - zipped folder, but bin/obj/packages folders removed

now I have 4 zips?! I just need one and a commad ;-)

Safest (no dependencies):

  1. Unzip solution.zip
  2. Open command prompt inside
  3. Run paket.cmd install && dotnet restore
  4. Open Visual Studio

thx

@MiloszKrajewski What Visual Studio version are you using?

I can repro.

cc @enricosada for ideas

VS 2017 community

Hi,

I've just found this:

[...] Since Microsoft.NETCore.App or NetStandard.Library metapackages are implicitly referenced, the following are our recommended best practices: Never have an explicit reference to the Microsoft.NETCore.App or NetStandard.Library metapackages via a item in your project file. [...]

and I think this is a reason. When paket generates list of dependencies during build it returns Microsoft.NETCore.App and/or NetStandard.Library so effectively they get referenced twice (implicitly and explicitly).

I guess, those meta-packages do not need to be referenced nor followed.

https://github.com/fsprojects/Paket/pull/2516

@enricosada would this already work for dotnet cli 1.0.4?

we're discussing #2516 with @enricosada - he want's to think about it for a little longer. so I won't merge #2516 for now

I've ran into this warning referencing https://www.nuget.org/packages/YoloDev.Expecto.TestSdk/

A PackageReference for 'Microsoft.NETCore.App' 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 [/tmp/b1dec36ea3504378addc8ada0006b363/MyCoolLib/tests/MyCoolLib.Tests/MyCoolLib.Tests.fsproj]

This issue discusses the warning a bit more https://github.com/dotnet/cli/issues/5346#issue-201118111

I'm also running into this when referencing YoloDev.Expecto.TestSdk, which basically breaks everything.

warning : A PackageReference for 'Microsoft.NETCore.App' was included in your project....

warning MSB3277: Found conflicts between different versions of "System.Runtime" that could not be resolved. 

(...).AssemblyInfo.fs(6,12): error FS1108: The type 'IComparer`1' is required here and is unavailable. You must add a reference to assembly 'netstandard, Version=2.0.0.0

error FS0074: The type referenced through 'System.IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard'. 

Is this an issue with YoloDev.Expecto.TestSdk or Paket?

What was the reasoning behind closing https://github.com/fsprojects/Paket/pull/2516?

Also I seemed to hit the same issue that altemann has.

I'm seeing this with a netstandard dll project which is referenced by two netcore exes.

Was this page helpful?
0 / 5 - 0 ratings