I have added Argu to my project and about 700MB of packages were downloaded together with it. This is related to Paket installs extra packages however I would like to undestand the subtle differences in specifiying the framework restrictions with >= or just framework: net46.
On my first try I just added Argu to the paket.dependencies file:
nuget Argu
As this resulted in a download of almost a GB of packages, I asked:
.\.paket\paket.exe why nuget System.Threading.Thread
And paket replied:
Paket version 3.27.02
NuGet System.Threading.Thread is a transitive dependency.
It's a part of following dependency chains:
-> Argu
-> FSharp.Core
-> System.Threading.Thread
-> MathNet.Numerics.FSharp
-> FSharp.Core
-> System.Threading.Thread
0 seconds - ready.
Then I added the following restriction to paket.dependencies:
nuget Argu framework: >= net46
However this resulted in downloading the same packages.
Finally I did:
nuget Argu framework: net46
And this specific restriction did indeed remove all the unneccassary packages:
Garbage collecting Microsoft.NETCore.Platforms
Garbage collecting Microsoft.Win32.Primitives
Garbage collecting NETStandard.Library
Garbage collecting System.AppContext
Garbage collecting System.Collections.Concurrent
...
However all my other dependencies are specified like this (mostly as a result, but not always, as I was troubleshooting the original issue):
source https://www.nuget.org/api/v2
nuget FAKE framework: >= net46
nuget FileHelpers framework: >= net46
nuget FSharp.Collections.ParallelSeq 1.0.2 framework: >= net46
nuget Fsharp.Data framework: >= net46
nuget MathNet.Numerics.FSharp 3.14.0-beta01 beta framework: >= net46
nuget MathNet.Numerics.MKL.Win-x64 2.2.0 framework: >= net46
nuget NuGet.CommandLine framework: >= net46
nuget Streams 0.4.1 framework: >= net46
nuget System.Linq.Dynamic 1.0.7 framework: >= net46
nuget Fsharp.Configuration framework: >= net46
So my question is Argu special in some way, or should I always use framework restrictions and specifically target 46 (or 45) instead of >=.
This does not occur with later versions of paket. However it is still possible to nuget packages that will result in the download of extra transitive dependencies due to the way some packages declare a dependency only on netstandard and not the full framework. For details see: https://github.com/fsprojects/Paket/issues/2564.
Related
I am trying to install nuget package "Scandit" to my project.
IDE: Visual studio Mac(Xamarin.Forms 4.6.0.726)
The following is the error message.
Attempting to gather dependency information for package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' with respect to project 'Modbusbutton3', targeting '.NETPortable,Version=v4.5,Profile=Profile78'
CACHE https://api.nuget.org/v3/registration5-gz-semver2/scandit.barcodepicker.xamarin/index.json
Total number of results gathered : 52
Gathering dependency information took 217.67 ms
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json - 5.27 ms
Attempting to resolve dependencies for package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Scandit.BarcodePicker.Xamarin.5.14.5.10'
Resolved actions to install package 'Scandit.BarcodePicker.Xamarin.5.14.5.10'
Found package 'Scandit.BarcodePicker.Xamarin 5.14.5.10' in '/Users/dej.pvi/Downloads/20200506-WiFi Solution for iOS/packages'.
For adding package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' to project 'Modbusbutton3' that targets 'portable45-net45+win8+wp8'.
Install failed. Rolling back...
Package 'Scandit.BarcodePicker.Xamarin.5.14.5.10' does not exist in project 'Modbusbutton3'
Executing nuget actions took 15.64 ms
Could not install package 'Scandit.BarcodePicker.Xamarin 5.14.5.10'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Can any one help how to solve this? Thank you!
As I checked Scandit.BarcodePicker github sample they are using two different packages.
Scandit.BarcodePicker.Xamarin
This package is installed only in Android and iOS project.
Scandit.BarcodePicker.Unified
This package is installed in every project.
According to your log Target Framework of your project is PCL. You might consider to convert you project to .NETStandard 2.0, because this might be other issue why you are not able to install this package. Check the link here.
I saw a few questions related to this on stack overflow but none of them helped. I am using VS 2019 community edition, I created an API project on .NetCore 2.1, and added the following nuget packages. (assuming all EF packages will be included by default)
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Design
After some time into the coding I needed to use MapToStoredProcedures in the OnModelCreating function..But its not available,
entitytypebuilder doesnot contain a definition for maptostoredprocedures
after looking for a few solutions, i tried to
install-package Microsoft.EntityFrameworkCore.Relational
which did not work as there was a version conflict issue...
NU1202: Package Microsoft.EntityFrameworkCore.Relational 3.0.0 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1).
then i tried to install SDK and restart VS, then i again tried to install Microsoft.EntityFrameworkCore.Relational nuget package but the same error was there.
Finally, I installed:
Microsoft.EntityFramework (6.3)
and an older version of Microsoft.EntityFrameworkCore.Relational (2.1.11)
which was successful but the MapToStoredProcedures function is still unavailable.
the using statement in the class also doesnt show Microsoft.EntityFrameworkCore.Relational namespace...
I am very confused as this function used to be available in VS 2013 with EF 6. :S
So i realize that EF 6 used to have the MapToStoredProcedures function and EF Core doesn't have it. (Not sure why they decided like that).
I changed my target framework to netcoreapp3.0 from netcoreapp2.1 and then i was able to install Tools and Microsoft.EntityFrameworkCore.Relational packages.
Finally, I am calling my sp as follows:
var dbResults = _gecontext.ParameterDetails.FromSqlRaw("EXEC dbo.get_nextParamSummary #UserId={0}", userId).ToList();
I'm confused.
I'm upgrading an old project that has references to FSharp.Core 4.4 everywhere yet the latest version of fsharp.core on nuget is 4.1.*.*
Is there a document explain what is going on with the version numbers going backwards?
The document is here, under "FSharp.Core version numbers"
FSharp.Core 4.4.0.0 corresponds to F# 4.0 running on .NET 4.5+.
The Nuget packages have a different versioning system where the first two digits are the F# version. Each nuget package targets one version of F#, but contains multiple FSharp.Core versions for different profiles. E.g. FSharp.Core Nuget version 4.1.12 is the latest Nuget package for F# 4.1 and contains FSharp.Core 4.4.1.0 for desktop, and various FSharp.Core portable profiles 3.N.4.1.
I'm using VSCode and Paket to add libraries from Nuget to an F# project/.fsproj file.
From VSCode, I use ctrl+shift+p and use the command Paket: Add Nuget Package (to current project) and enter
FsVerbalExpressions version 0.4.0
Unfortunately, Paket fails with the following error:
Paket version 3.23.2.0
Adding FsVerbaExpressions 0.4.0 to
c:...\paket.dependencies into group Main
Resolving packages for group Main:
- FsVerbaExpressions is pinned to 0.4.0
Package not available.
Message: Couldn't get package details for package FsVerbaExpressions 0.4.0 on https://www.nuget.org/api/v2.
Paket failed with:
Could not find versions for package FsVerbaExpressions on https://www.nuget.org/api/v2.
I know that FsVerbalExpressions is available on Nuget. I need the older version because the project I'm working on is targeted at .NET 4.5 and the newer version of FsVerbalExpressions will only work with .NET 4.6.1.
Typos happen. Make sure you proofread your error messages before looking for answers that are already in front of you.
In Grails 3 project we are using some dependencies as below. For the plugin or dependencies which has version it downloads as per version specification from remote repository. We assumed it is downloading the latest dependency available when we did not mention version, but when we checked the hibernate dependency it is downloading '4.3.10.6' version in the project whereas remote repository has latest version. So how does grails or gradle download dependencies without version?
compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"
compile "org.webjars:bootstrap:3.3.5"
compile "org.webjars:bootstrap-tagsinput:0.5"
Note : We don't have any errors or issues with this in our project
If no version is specified, Gradle will use transitive dependency management, starting with the Gradle version number, and the packages that that Gradle version depends on. If transitive dependency management doesn't care. Then Gradle will search through the hierarchy of repositories and flat files and flat trees and dependent projects and take the latest version.