Nuget not searching in custom package sources - nuget-package

I have added 2 custom package sources. If I search in nuget package manager, I find my package. If I install the package it fails with the following error:
Restoring packages for .NETStandard,Version=v2.1...
GET https://api.nuget.org/v3-flatcontainer/mypackage.test/index.json
NotFound https://api.nuget.org/v3-flatcontainer/mypackage.test/index.json 125ms
Resolving conflicts for .NETStandard,Version=v2.1...
Unable to find package mypackage.test. No packages exist with this id in source(s): nuget.org
Package restore failed. Rolling back package changes for 'FormsApp1'.
In the logging I see that package manager only searches in nuget.org and not in my custom sources.
I am using VS for mac 17.4.2, Nuget 6.4.0.117
Questions:
How do I tell package manager to also search in my custom sources?
How do I install a specific version of nuget on Mac? I would like to try version 6.3.1.1.

I solved this issue by installing VS2019.
When installing VS2019 it replaces VS2022. But you can install VS2022 Preview alongside. After installing VS2019, the package manager works correctly in VS2019 as well as VS2022 Preview.
So I guess the installation of VS2022 is broken as it was a fresh install on a new laptop.

Related

How do I install an older version of Nuget package and its dependencies and save them to packages.config

I am trying to install a version of a package that is not the latest on the public Nuget repository. (because each version requires blessings from the corporate technology controls department) With the Package Manager UI in Visual Studio 2012, I did not find an option to install an older version. With the commandline tool, I don't see an option to save the package version and its dependency versions into packages.config (which the UI does automatically). The package has 50 dependencies and sub-dependencies. Is there a way to achieve both older version and save to packages.config?

Visual Studio 2015 Nuget package is not installing

I am trying to install package Microsoft.CodeAnalysis using Nuget
It does download a lot of packages and then it rolls back every thing and gives me the following error
An error occurred while downloading package 'System.Reflection.Metadata 1.2.0' from source 'https://www.nuget.org/api/v2/'
Does someone have any solution for this ?
I was able to temporary workaround it by installing beta version of this package:
Install-Package System.Reflection.Metadata -Pre

NuGet Package Manager's package source is not available

I need to use the NuGet Package Manger to install some packages for my project, however, I find that I cannot use it in Package Manager Console: I cannot type anything and see the package source is not available, it is grey.

Installing Windows Azure Storage v3.0.3 failing using NuGet

I am attempting to update my program but installing Windows Azure Storage 3.0.3.0 via NuGet but when I do this I get the following:
Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.6.0)'.
Attempting to resolve dependency 'System.Spatial (= 5.6.1)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.6.1)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 5.0.6)'.
Attempting to resolve dependency 'Microsoft.Data.Services.Client (≥ 5.6.0)'.
Attempting to resolve dependency 'Microsoft.Data.OData (= 5.6.0)'.
Already referencing a newer version of 'Microsoft.Data.OData'.
To be honest I think this an issue with the released package as I know it is new.
As anyone seen this before? If so how have you resolved this problem?
I know I could just rollback OData to the version that is supported but wondered if there were other options?
From the your comments it looks like they already had a version of Odata greater than 5.6.1 installed in your project.
Therefore:
Since the dependency graph generated on install would dictate the Odata be 5.6.0
And the you already has a higher version of Odata installed in your project
The installation of the package should fail, as we will not downgrade any package during an install-package or update-package
For how to fix this, first make sure you have at least the 2.8 version of NuGet installed. Then you should use the Package Manager Console and enter:
Update-package Microsoft.data.odata –version 5.6.0
Then either:
Install-package windowsazure.storage –version 3.0.3
Or:
Update-package windowsazure.storage –version 3.0.3
Depending on whether it’s an upgrade or an install of the Windows Azure storage libraries.
I fixed the exact same problem by downgrading these to 5.6.0:
Microsoft.Data.OData
Microsoft.Data.Edm
System.Spatial
After updating Windows Azure Storage to 3.0.3.0 I was able to re-update them to 5.6.1.
I found this command useful to downgrade:
uninstall-package <package> -force
-force will continue regardless of dependencies, but in this case we are adding them back so that should be fine.
Microsoft.Data.Services.Client is looking for Microsoft.Data.OData version equal to 5.6.0. However as per the dependency of Windows Azure Storage 3.0.3.0 it looks for Microsoft.Data.OData version >= 5.6.0, so latest version of Microsoft.Data.OData gets installed which is higher than 5.6.0.
So while installing Microsoft.Data.Services.Client it finds that there is already higher incompatible version of Microsoft.Data.OData installed and fails to update the nuget package.
Easiest solution to this problem is as below:
If you are updating the Windows Azure Storage nuget package please follow below steps:
Update the Microsoft.Data.OData version to 5.6.0 using nuget package
manager command Update-Package Microsoft.Data.OData -Version 5.6.0
Update the nuget package Windows Azure Storage to 3.0.3.0
If you are installing the Windows Azure Storage nuget package, follow below steps:
Install the Microsoft.Data.OData version to 5.6.0 using nuget
package manager command Install-Package Microsoft.Data.OData
-Version 5.6.0
Install the nuget package Windows Azure Storage 3.0.3.0
Just type in the below command in Package Manager Console.
PM> Install-package windowsazure.storage –version 3.0.3

Install-Package: Could not install package WPtoolkit error [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Adding NuGet ndef library to windows phone 8 project
While trying to install the WPtoolkit i get the following error...
PM> Install-Package WPtoolkit
Successfully installed 'WPtoolkit 4.2012.10.30'.
Successfully uninstalled 'WPtoolkit 4.2012.10.30'.
Install failed. Rolling back...
Install-Package : Could not install package 'WPtoolkit 4.2012.10.30'. You are trying to install this package into a project that targets 'WindowsPhone,Version=v8.0', but the packag
e does not contain any assembly references that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
Is there something that am i missing?
The NuGet is updated to the latest version too...
A ha!
At the FAQ's section...
Q - I have WP8 SDK and I installed the NuGet package, it is still installing the 7.1 version of the toolkit assembly, or I get an error – “You are trying to install this package into a project that targets 'WindowsPhone,Version=v8.0', but the package does not contain any assembly references that are compatible with that framework.”
A – You have an older version of NuGet.
Install the latest NuGet from www.NuGet.org . Close and restart all the
instances of Visual Studio.
Now install the package. It will install correctly.
WP8 projects are supported from Nuget 2.1 onwards.
After that go to xaml page type

Resources