Npgsql nuget installation failed - visual-studio

I have .NET 4.6.1 and 4.5.1 and VS 2013
I am installing Npgsql 3.2.0 (PostgreSQL .NET provider).
It fails:
Attempting to resolve dependency 'NETStandard.Library (≥ 1.6.1)'.
'NETStandard.Library' already has a dependency defined for 'Microsoft.NETCore.Platforms'.
Any ideas?
Thanks!

The culprit is likely VS2013, or rather your version of nuget. Can you make sure you have the latest version of the nuget extension and retry?

This was resolved by installing the latest NuGet Package Manager, the latest version is 2.12.0.817
https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca
Note that: Don't forget to restart VisualStudio.

Related

Failed to install ClosedXML dependency

I need to install ClosedXML dependency to build a C# project with .net framework 4.7.2 but when trying to install I always get the same error: "Cannot resolve dependency 'SixLabors.Fonts'. Sources used: 'nuget.org', 'Microsoft Visual Studio Offline Packages'"
I have tried everything to install from the nuget package manager
What version are you trying to install? I think you should install SixLabors.Fonts first and then install ClosedXML, as the newer versions of ClosedXML depend on it.
I faced the same proplem when trying to install ClosedXML today. ClosedXML depends on the SixLabors.Fonts library which is only available in beta at the moment.
To find the library with the NuGet Browser, make sure to check the "Include prerelease" box. You should then be able to find it listed below. After installing SixLabors.Fonts, you should be able to install ClosedXml without any further issues.

How to downgrade Nuget to previous version

I am not looking to downgrade a Nuget package, but Nuget itself. I am trying do downgrade from 6.2 to 6.1 as 6.2 is causing nuget errors for my project after upgrading.
You can download latest and previous versions of Nuget on their official download page: https://www.nuget.org/downloads

Nuget Visual Studio 2022 control dependency version

Whenever I try to install any package from Nuget through Visual Studio 2022 - be it the GUI or package manager console, I can't seem to find a way to get the highest dependency version.
For example: if I add latest version 1.0.152 protobuf-net.Grpc to my project it has a dependency on Grpc.Core.Api >= 2.36.1. The current version for Grpc.Core.Api is 2.46.3...
In the GUI under options I have no option to control dependency version what so ever it seems like the Install-Package cmdlet doesn't obey -DependencyVersion Highest:
Install-Package protobuf-net.Grpc -DependencyVersion Highest
Installing NuGet package protobuf-net.Grpc 1.0.152.
Committing restore...
Successfully installed 'Grpc.Core.Api 2.36.1'
Successfully installed 'Microsoft.NETCore.Platforms 2.1.0'
Successfully installed 'protobuf-net 2.4.6'
Successfully installed 'protobuf-net.Grpc 1.0.152'
Successfully installed 'System.Memory 4.5.3'
Successfully installed 'System.Private.ServiceModel 4.5.3'
Successfully installed 'System.Reflection.DispatchProxy 4.5.0'
Successfully installed 'System.Security.Principal.Windows 4.5.0'
Successfully installed 'System.ServiceModel.Primitives 4.5.3'
How can I force Nuget to install the highest dependencies version?
According to your description here are some suggestion:
First check your project type “-DependencyVersion Highest” only used in packages.config format.
You can see the project type support about two package management formats: Projects.config and PackageReference.
Someone posted a similar issue on github, see the issue here. Hope this help you.
If you want to use “Grpc.Core.Api 2.46.3 “, you can try to delete the bin and obj folder and then go to Tools>Options>Nuget Package Manager>General>Clear All Nuget Caches.
Then you can install Grpc.Core.Api 2.46.3 package before install protobuf-net.Grpc 1.0.152

Visual Studio 2017 project referencing old version of Microsoft.AspNetCore.App

I was using .Net Core 2.1.1, and recently updated the SDK to 2.1.401 (.Net Core Runtime 2.1.3). When i create a new project the version of Microsoft.AspNetCore.App under Dependencies > SDK is still 2.1.1. Looking at the properties of Dependencies > NuGet, the package is being referenced from "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.app\2.1.1"
I tried installing Package 2.1.3 using NuGet package manager, and it downloaded all dependencies from NuGet despite that i have 2.1.3 already installed on my machine.
How do i force existing / new project to use the latest version of packages from the SDK install ?
You shouldn't need to update the version of Microsoft.AspNetCore.App manually in your project. 2.1.1 is perfectly fine. Your application will run on the latest 2.1.* framework installed on the machine.
If you publish a self-contained application, the tooling will automatically switch to the latest known version of 2.1.* at build time for the self-contained build only. (-r win-x64 argument)
This may or may not change for the 2.2 or 3.0 releases, read/follow this GitHub issue and thread for more information.
This is a bug as it has already been reported but for now this can be the solution.
In ProjectName.csproj file:
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeFrameworkVersion>2.1.3</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3" />
</ItemGroup>

Is it possible to install Signalr with vs2010

I am trying to install SignalR in my vs2010 project and I get the following error -
Could not install package 'Microsoft.Owin.Security 2.0.2'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', 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.
How can I install SignalR on vs2010 ??
You need to install 1.x
>Install-Package Microsoft.AspNet.SignalR -Version 1.1.3
2.x requires 4.5 of the framework
Here is the solution you are looking for,
http://rionscode.wordpress.com/2013/04/06/getting-signalr-ready-in-visual-studio-2010/
v1.2.2 is the last version of SignalR for the Visual Studio 2010 with .Net Framework 4.0
PM> Install-Package Microsoft.AspNet.SignalR -Version 1.2.2

Resources