Update nuget package with option -IgnoreDependencies get error - visual-studio

I could not update the WindowsAzure.Storage NuGet Package with the option -IgnoreDependencies. When I update it with following command in the Package Manager Console, I always get the error:
update-package WindowsAzure.Storage -IgnoreDependencies
The error:
Update-Package : packages
At line:1 char:15
+ update-package <<<< WindowsAzure.Storage -IgnoreDependencies
+ CategoryInfo : NotSpecified: (:) [Update-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand
Now my workaround is uninstall that package, then install it with the option -IgnoreDependencies. But I have a lot of projects and I need update it frequently. So I want to know the best way to resolve this issue.
Thanks in advance.

Update nuget package with option -IgnoreDependencies get error
I can reproduce this issue on one computer, but I can not reproduce it on another computer. I compared all the differences between them, the final finding is the NuGet Package Manager for Visual Studio version of the difference when you update the nuget package WindowsAzure.Storage with option -IgnoreDependencies.
The version of NuGet Package Manager for Visual Studio on the computer which have the issue is 3.4.4.1321, the version on another one is 3.5.0.1996. So to resolve this issue, please update the nuget package manager to the 3.5.0.1996:
Uninstall the 3.4.4 from Tools->Extensions and Updates->NuGet Package Manager for Visual Studio. Restart the Visual Studio. Then install the 3.5.0.1996 from nuget.org, restart the Visual Studio.
Note: This issue only occurred when you update the nuget package WindowsAzure.Storage from 4.3.0 with -IgnoreDependencies option.

Related

Why can I install NuGet v4.0.10 in VS2019 but not in VS2012?

I want to get Npgsql for a project targeting .Net 4.5 in Visual Studio 2012. It appears the latest Npgsql version supporting that version of .Net is 4.0.10. In Visual Studio 2012, with package source set to nuget.org, I got the following:
PM> Install-Package Npgsql -Version 4.0.10
Install-Package : Unable to find version '4.0.10' of package 'Npgsql'.
At line:1 char:16
+ Install-Package <<<< Npgsql -Version 4.0.10
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
But in Visual Studio 2019, with the same source, the package was installed successfully. What do I have to do to install it in my VS2012 project?
But in Visual Studio 2019, with the same source, the package was
installed successfully. What do I have to do to install it in my
VS2012 project?
First, thanks to Lex for sharing the useful info with us.
Since VS2012 is too old to maintain it, the highest version of Nuget in VS2012 is v2.8.60318.667. And Npgsql 4.0.10 needs nuget v4.xxx or above which is not supported in VS2012.
Solution
If you want to install this nuget package in VS2012, you cannot install the latest version(4.0.10) of the Npgsql nuget package, you should install the version which nuget v2.8.60318.667 supports.
And Npgsql 3.1.10 is supported in VS2012 which l have tested successfully.
1) If the nuget version in VS2012 is not the latest, you should update nuget version to the latest v2.8.60318.667. (Tools-->Extensions and Updates-->Updates)
2) Open Package Manage Console by Tools-->Nuget Package Manager-->Package Manager Console and type this:
Install-Package Npgsql -Version 3.1.10
Update
Just install an old version of Npgsql (<=3.1.10)
Hope it could help you.

Visual Studio 2017 Professional- Unable to find package at source

I was trying to add package through nuget package manager=> package manager console and from Manage Nuget packages from solution directly. I am trying to install Newtonsoft.Json from Package Manager Like this Install-Package Newtonsoft.Json but unable to find from the source i.e
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
This gives me result like this:
PM> Install-Package Newtonsoft.Json
Install-Package : Unable to find package 'Newtonsoft.Json' at source ''.
At line:1 char:1
+ Install-Package Newtonsoft.Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:01:30.2571879
I think that the source here is blank. May be because of that it is unable to load packages. I have tried to manage the package manager setting but not been able to connect. My package manager setting is like this:
Despite of having good connection of internet I am not been able to install package. My questions are:
How should I install package?
What am I doing wrong to install package?
Assuming you are using Windows OS
Have you initialised vs 2017 after installation or Have you updated your vs 2017?
If not then please initialized it.
Restart your PC.
Open your project in vs 2017
Check your nuget package manager settings.
Name:nuget.org
Source:api.nuget.org/v3/index.json
Now, run nuget package manager from tools=>Nuget Package Manager=>Package Manager Console and write your install-package command or run Manage nuget package manager for solution from tools=>Nuget Package Manager=>
Hope,it helps you.
Your VS 2017 is probably using some kind of proxy setting which is preventing it from accessing the internet.
To check if VS can access internet try opening any web page from within VS Browser. If you cannot browse then my hunch is correct.
Solve the proxy issue and you should be fine.
Hope it helps.
I resolved this issue by adding nuget.org which was missing in my package source.
Go to Tools>Nuget package manager>Package Sources>
Click Plus sign >
Name: nuget.org
Source : https://api.nuget.org/v3/index.json
Now your Visual studio will be connected to Internet and package will be downloaded successfully.

Unable to Add System.ServiceModel Nuget Package in Xamarin Form PCL Project

I am trying to follow the official xamarin tutorial to make use of WCF Services from a Xamarin Form PCL project (URL /guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/ on Xamarin website)
However, at the time of referencing the System.ServiceModel nuget package, I get the following error and the package does NOT get installed:
Could not install package 'System.ServiceModel 1.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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.
I also tried profile 78 without luck (I removed Windows Phone 8.1 as explained here since there is no WCF support).
I tried different profiles for the PCL project as explained here, but without success.
Also, I tried using the Package Management Console and got similar error:
PM> Install-Package -Verbose
cmdlet Install-Package at command pipeline position 1
Supply values for the following parameters:
Id: System.ServiceModel
GET ... OK
Attempting to gather dependency information for package 'System.ServiceModel.1.0.0' with respect to project 'Mobile\MobileCashRegister', targeting '.NETPortable,Version=v4.5,Profile=Profile7'
Attempting to resolve dependencies for package 'System.ServiceModel.1.0.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'System.ServiceModel.1.0.0'
Resolved actions to install package 'System.ServiceModel.1.0.0'
Install failed. Rolling back...
Package 'System.ServiceModel.1.0.0' does not exist in project 'MobileCashRegister'
Package 'System.ServiceModel.1.0.0' does not exist in folder 'C:\dev\DevCuddlUpSolution\packages'
Install-Package : Could not install package 'System.ServiceModel 1.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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.
At line:1 char:1
+ Install-Package -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
How can I know which profile needs to be selected for the System.ServiceModel nuget package to be installed successfully?
Please note I am using Visual Studio 2015 Professional and the latest available Xamarin.
System.ServiceModel 1.0.0 does not contain any assemblies in any lib folders. It just seems to contain NuGet.exe so you will not be able to use it.
It is also not an official Microsoft NuGet package.

C# - Xamarin : installing android.support.design package

i'm trying to install "Install-Package Xamarin.Android.Support.Design" into Xamarin Visual Studio 2015, but after it starts downloading, this error occurs
Install-Package : Unable to find package 'Xamarin.Android.Support.Design'
At line:1 char:1
+ Install-Package Xamarin.Android.Support.Design
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
i don't understand any of that, what is wrong?
Ensure that you have a proper NuGet source defined. You can go to Tools -> Options -> NuGet Package Manager -> Package Sources to make sure. i.e.: https://api.nuget.org/v3/index.json
Secondly you should double check that your NuGet version is the latest. Go to Tools -> Extensions and Updates and update if you aren't on the latest version.
Finally you could also try to manually download the package from https://www.nuget.org/packages/Xamarin.Android.Support.Design/ and setup a local NuGet repository to ensure that works. Chances are one of the first bullets should fix this.
Source: https://github.com/NuGet/Home/issues/842

How can I install an old version of a ReSharper plugin?

I'm using ReSharper 8.0 in Visual Studio 2010. ReSharper 8.0 uses a NuGet-based Extension Manager for plugin management, which makes it very easy to find and install plugins, but this Extension Manager will only offer up the latest version of any given plugin. It also keeps track of plugin updates, and offers to update plugins when a new version is available.
This is where my problem has arisen. A particular plugin I use (GoToWord) has been updated, and the latest version (0.9.3) appears not to work. I cannot work out any way to roll back to the previous good version (0.9.1.1), nor a way to install an older version once I've uninstalled it.
I've tried opening the regular NuGet package manager console (at Tools | Library Package Manager | Package Manager Console) and issuing this command:
Install-Package resharper.GoToWord -version 0.9.1.1
But this fails at the dependency resolution phase, presumably because ReSharper isn't known to the regular NuGet:
Attempting to resolve dependency 'ReSharper (≥ 8.0)'.
Install-Package : Unable to resolve dependency 'ReSharper (≥ 8.0)'.
At line:1 char:16
+ Install-Package <<<< resharper.GoToWord -version 0.9.1.1
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Does the ReSharper Extension Manager version of NuGet have a console? Or is there some other way to install an old version of a plugin?
Sadly, we didn't implement support for installing older versions of a plugin. But you should be able fake it manually, by editing the packages.config file in the %APPDATA%\JetBrains\ReSharper\vAny folder and adding a line such as:
<package id="ReSharper.GoToWord" version="0.9.1.1" />
If you restart VS now, and go to the extension manager, you should get prompted that some extensions aren't installed, and clicking the package restore button should download and install the right version.
Have you reported the issue on the project's GitHub page? https://github.com/controlflow/resharper-gotoword/issues

Resources