New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paket is failing to resolve second level dependencies and failing to add Analyzers section to csproj #1929
Comments
mhm. https://www.nuget.org/packages/Microsoft.CodeAnalysis.Common/2.0.0-beta3 is tricky. @matthid ideas?! |
@tsibelman as workaround until we find a solution you can add the analyzer package manually in deps and references file. Not nice, but at least you can keep working for now. |
It not just analyzer package but all of it dependencies, BTW I noticed following, when I remove framework restriction the reference looks like this System.Reflection.Metadata.dll
As you can see TargetFrameworkVersion 4.5 and 4.5.1 are not here, but according to https://docs.microsoft.com/en-us/dotnet/articles/standard/library 1.1 is equvalent to .net 4.5 |
@forki We prefer anything to netstandard because people don't like it. Nuget obviously prefers netstandard (which makes sense as it is the vnext of portable). Creating the test cases is still on my todo list. This is a perfect example for a test-case... |
Is it possible the issue is in these lines from Paket.Core/FrameworkHandling.fs?
If I undertstand it correctly it says that Framework v 4.5.1 contains framework 4.5 and netstandard v1.2 |
@tsibelman That's fine because we go through this recursively to find compatible frameworks. It's just that our algorithm to give penalty to specific frameworks is giving netstandard a lot of penalty because we don't want to download the internet... |
I see, I do not know F#, but I just tried to understand why in the sample I gave above condition do not contain any reference to 4.5.* versions, it looks that it should. |
I mean here:
|
@forki by the way it perfectly fine that paket chooses Portable Class Library (.NETFramework 4.5, Windows 8.0) it not the issue here, the problem is with invalid conditions in project references |
what is invalid excatly? don't see it yet |
System.Reflection.Metadata.dll is of netstandard1.1 it means it can be consumed by all of these frameworks But in this condition it allows consumption of only for these ($(TargetFrameworkIdentifier) == '.NETFramework' And |
I tried installing I can try to PR a failing test but don't think I can fix it as I don't know f#. |
where is that System.Reflection.Metadata snippet from? It's not in the sample!? |
It happens when I try to remove framework: net451 from dependency file |
To me this discrimination of 4.5.1 looks like a root cause of the original bug |
Ok let's analyze by hand:
brings us to https://www.nuget.org/packages/Microsoft.CodeAnalysis.Common/1.3.2 this one specifies that it needs
so from here on netstandard11 is filtered out. |
I downloaded System.Reflection.Metadata package looks like it contains internaly two versions of dll one in portable folder and one in netstandard11 folder. It do not contain netstandard13 version at all. |
yes but that's not important. Important is that Microsoft.CodeAnalysis.Common only requires System.Reflection.Metadata for netstandard 1.3 and higher |
But portable-net45+win8 requires System.Reflection.Metadata (>= 1.2.0). What wrong with this ? |
that one is indeed a bug and an update is under way. with the next version it will install that lib for portable-net45-win8 but this update doesn't solve your issue yet. currently we only install portable libs for net45 when we don't find other specifications. but this one has net standard specifications. so we assume these people don't want it to install System.Reflection.Metadata |
Yes it did not solved the as you predicted, looks like you need to take netstandard if all other options do not fit. |
no it clearly states that it doesn't need it. @matthid what do you say? |
As I understood it It says that for frameworks fiting portable-net45+win8 it should bring System.Reflection.Metadata (>= 1.2) I use framework: net451 so it in range of portable-net45+win8 Maybe this doc will help |
ah that doc states portable-net45+win8 is a alias for netstandard11 we could make use of that definition |
Great, hope it will fix the issue |
new version released. |
It did not fixed, also I looked into your commit I don't see that you changed anything important in there |
I cleaned the caches and tried again on new project still no change. As you wrote Microsoft.codeanalysis.common.1.3.2 package specifies dependencies for netstandard1.3 and portable-net45%2Bwin8 So I performed following experiment, I change my project version from 4.5.1 to 4.5 and it all worked perfectly. So it looks like you do not consider 4.5.1 framework as a super set of portable-net45%2Bwin8 for a question of dependencies resolution. |
Yeah I changed another thing so that it works for 4.5.1 as well. Integration tests are running. |
please retry |
It did not helped when I remove line framework: net451 from dependency file I see following: Microsoft.CodeAnalysis.Common in packet.locket has dependency System.Reflection.Metadata (>= 1.2) - framework: net45, >= netstandard11, portable-net45+win8 In csproj I see following
As you can see 4.5.1 is still not there |
It works for me. Are you sure you run update -f with latest paket? Am 29.09.2016 09:23 schrieb "Michael Tsibelman" notifications@github.com:
|
Yes update -f helped now it works, thank you. |
The lock file looks better after running update -f now. |
Description
I have reference to package that has a reference to ms code analysis, paket is failing to resolve underlying dependencies for the package and it failing to add Analyzers section to csproj, here is a minimum dependencies file I use
source https://www.nuget.org/api/v2/
Repro steps
Reaname Repo.zip.txt file to Repo.zip and open, you will see sollution with two projects one has paket references other using nuget references, you can check the difference.
Repo.zip.txt
Expected behavior
I expect it to behave in the same fashion as nugget
The text was updated successfully, but these errors were encountered: