In VS Manage Nuget Packages window, When choose nuget from browse and see the listed versions, the message showing like Blocked by package.config after under this message all the version again listed. This is for all packages in nuget.org.
Can anyone tell me the reason why shown that message like that?
enter image description here
packages.config has an optional attribute allowedVersions, which can be used to constrain the versions that are allowed to be installed.
It seems to be a bug that will be fixed in NuGet 5.4 : https://github.com/NuGet/Home/issues/8679
You still can use the command Update-Package to change the version of any installed package.
you could try this steps:
Remove the "AllowedVersions" attribute from "packages.config"
Try to reinstall the package.
the package will be installed successfully.
Related
I'm trying to install Xamarin.CommunityToolkit(ver. 2.0.5) from Nuget Packages,
but I get this error message:
So I installed Xamarin.AndroidX.Lifecycle.LiveData with version 2.4.1.1, as it says
then I tried to install CommunityToolkit again, and again I've got the same message but with different compliant.
This time it wants me to install Xamarin.Google.Android.Materia(1.6.0).
I repeated the process a couple of times, and finally I was able to install CommunityToolkit successfully,
but then, when I build the project I get this:
I don't know what should I change to get rid of this error, it was working all fine before I installed this CommunityToolkit package
Here's my .csproj file:
I did try to add "net6.0-windows" to tag with various combinations, but with no effect.
Problem repeats on a newly created project aswell.
I'm using Microsoft Visual Studio Community 2022 (64-bit) Version 17.3.4
For MAUI use CommunityToolkit.Maui package instead of Xamarin.CommunityToolkit.
Official repo
Official docs
I am trying to push packages to the VSTS package manager from the command line like this
nuget.exe push -Source "MySource" -ApiKey VSTS *.nupkg
But I am getting the following error
The specified source 'MySource' is invalid. Please provide a valid source.
Event though the source exists.
Any idea why it doesn´t recognize MySource?
I am using TFS2018.
This used to work initially and I pushed multiple packages. I also tried removing the source and creating a new one but the problem persists. Any help suggestions appreciated.
I forgot to add the source using the following command:
nuget.exe sources Add -Name "MySource" -Source <url>
In my case it was not letting me use the feed because of having it disabled in the VS 2019.
Just go to the VisualStudio and from the Tools menu select Nuget Package Manager and then Package Manager settings
and then from the opened Dialog, select Package Sources and in the list of sources, check the one that you want to enable.
I have the samme issue but in my case the problem is that I have the target source disable on my source list (I disable it but I forgot to re enable it)
I found the different documentation confusing. Some places, I saw that --source should be set to domain_name/repository_name, however it worked for me once I used the name from "Avaiable Package Sources -> Name". I.e. --source "My Package source" from the above example.
I have a project where I need Microsoft.TeamFoundation.DistributedTask.Common.Contracts. According to nuget.org there is a 15.114.0-preview package. But, Visual Studio says that there is no package like this.
I clean all local cache and doesn't help.
How can I solve it? Generally, how much time is needed for a package to go through the spreading process if there is any?
You seem to be looking at the wrong package in Visual Studio Package manager window.
Microsoft.TeamFoundation.DistributedTask.Common.Contracts has latest version as 15.114.0-preview
while Microsoft.TeamFoundation.DistributedTask.Common has latest version as 15.112.1
Hope this helps.
-AG.
I have an ASP.NET MVC 4 application. I used NuGet to update all of the NuGet packages that were installed when I created the application. One of the packages was Microsoft.Bcl.Build.
After updating these, NuGet displayed the following message at the bottom of its window:
I have since restarted Visual Studio several times, but the message still exists. When I checked the installed packages, it did appear that the updated version (1.0.8) of the package was present.
How can I fix this?
Instead of deleting all of ~/packages, see if there are any *.deleteme files in ~/packages and delete them. Then restart Visual Studio.
I believe this problem is caused by the packages being read-only or otherwise inaccessible at the file system level.
Packages under source control
Temporary work-around (untested)
Check out the entire packages folder prior to telling NuGet to restart Visual Studio to delete the packages.
Permanent work-around
I found that this could be permanently resolved by removing the packages from source control and instead using NuGet Package Restore.
Packages not under source control
Temporary Work-Around
I worked around this by deleting from the solution's packages folder all of the files that referenced the package in question. Specifically, these were:
Folder: Microsoft.Bcl.Build.1.0.7
File: Microsoft.Bcl.Build.1.0.7.deleteme
In my case, the relevant package folders remained in ~\packages, although they were empty. I deleted the folders and restarted Visual Studio, and this warning went away.
I've just deleted the folders of each package that had error in the Packages folder in my solution folder and also deleted the .deleteme files and everything works fine!
1) Delete the entire ~\packagesfolder.
2) Restart VS.
3) Go to Manage NuGet Packages and Restore
I'll agree that this can happen when your packages folder is under source control. If you like to have it there, instead of removing the bindings you can check it all out, remove the package with the NuGet Package Manager, and then check in after wards.
In my experience, I found my answer on this thread, but using a combination of a couple of different answers above so I thought I would share what I found.
I had the exact same issue with "Microsoft.Bcl.Build" as the original poster. I had been trying to update references for other functionality using NuGet and had issues with some of the updates (compatibility then rollbacks). After this NuGet failure, I started getting this error.
I initially used the selected answer and Jedidja's answer and was able to get this to work, but it only partially solved my problem. It did fix the VS restart error, but it caused a downstream issue with TFS as I could no longer check in the project as it was expecting that "*.deleteme" file. This got me thinking, so I did some testing. When I restored the file from recycle bin, I started getting the restart error again.
Here is where I deviated from the posted answers and got my full resolution to my version of the problem.
When I checked into TFS this time, the project checked everything in (after I got the projects all updated using NuGet while the "*.deleteme" file was deleted). Once it checked everything in, I noticed that file was still pending check-in so I checked the solution in again and TFS accepted that file, but it was as a deletion....assuming it checked in the first time and then VS auto deleted it which required the second check-in. Anyway....after the last pending change check-in, the file was gone and VS no longer complained about needing to be restarted. I can't say for sure because the problem is gone, but I get the feeling if I had checked the code in before deleting the file in the first place it might have solved the problem without manual file manipulation.
** Hi, everybody.**
i resolve this problem this ways.
If you have source control run the vs as administrator ( it is important )
in the solution packages -> delete thing about packages.
sample -> i deleted all entity framework version folders.
restart the vs
open solution and solution right click -> manage nuget packages for this solution.
you will see restore button :) restore
that is all.
If you are using Entity Framework 6, then you can install the NuGet package "EntityFramework.SqlServerCompact".
This enabled me to use the standard ASP.NET Identity tooling that comes with the project templates for 2013 and MVC5.
Is there a way to load a package from an alternative server when Visual Studio Package Manager (NuGet) is responding with a "The remote server returned an error: (503) Server Unavailable" message?
This is an obscure condition that will likely only occur on an "enterprisy" network environment. If these conditions apply you:
you are required to access the Internet via an HTTP proxy server
the HTTP proxy server requires a valid user ID & password (or AD authentication) to allow requests to proceed
you've been messing with cool developer tools that were ported to Windows from a Linux/Unix environment
the new cool tool(s) work after adding the HTTP_PROXY (or possibly HTTPS_PROXY or both) environment variable(s)
you can access the NuGet servers from a browser without getting a 503 error
Then it's likely you broke NuGet by inadvertently invoking this configuration feature. I'm not sure exactly how the environment variable breaks NuGet but I suspect NuGet is detecting & using the http_proxy URL but sending an empty user ID & password which causes the HTTP proxy to reject the request.
Fix: remove the environment variable(s) you added and see if the cool tool can be configured to use an HTTP proxy without them.
Update: Ran into a version of this issue with the NuGet config file referenced in the "this configuration feature" link above. Open this file:
%appdata%\nuget\nuget.config
in your favorite editor. If it contains elements with http_proxy or https_proxy then removing these elements may fix the issue too.
PS: Hopefully I'll get an up vote from Colonel Panic :-)
If you have used the package in the past it is probably in your cache. You can add the local cache as an available package source by going into the Library Package Manager Settings under the Tools menu in Visual Studio. For Visual Studio 2012, choose Tools, Library Package Manager, Package Manager Settings, and then click on Package Sources.
In the Available package sources section, type a name like "Cache" and then in for the source, browse to %LocalAppData%\NuGet\Cache. You may need to use Windows Explorer to translate %LocalAppData%\NuGet\Cache into the full path (usually C:\Users\YourAccountName\AppData\Local\NuGet\Cache).
Once you have the Cache as an available source, you can now use the Package Manager Console (found under the View menu under Other Windows or also under the Tools menu under Library Package Manager).
From the Console (which is a PowerShell window with commandlets for NuGet) you can type "get-help NuGet" to see available commands.
Then using Get-Package, you can get a list of Package ID's. Make sure the "Package source" is set to "Cache" (or whatever you called it) and the Default project is set to the project you need manipulate, both of these are dropdowns located at the top of the Page Manager Console. You can also use the Get-Project to verify you are working against the correct project in your solution.
Finally, you can type Install-Package and when prompted enter the Package ID from the output of the Get-Package commandlet.
i had also this problem, it was becouse of my network.
if you have any blocking on your Internet, (like in companies internet or etc..)
you may not allowed to download the nuget package.
try to download the package in another network, maybe it can help you!
Talbott's answer did not work for me, as my cache was empty. However, if you have used the package in another solution, you can copy the items you want from the "packages" folder in the other solution to a packages folder in your target solution.
If you have no packages installed in the target solution, you may need to add the following to a repositories.xml file in the packages folder:
<?xml version="1.0" encoding="utf-8"?>
<repositories>
</repositories>
After doing that, the packages appeared to be installed in my solution and I was able to add them to projects.
Additional Note: I had to use the "Manage NuGet Packages for Solution" option at the solution level to add the package to individual projects. Using Install-Package from the console still returns a 503 even though the packages is already installed in the solution.
You can also get this error if you are using a VPN client (e.g. Cisco AnyConnect) and you have recently renewed your VPN certificate. The issue can occur after you have updated your certificate, but before you have rebooted. A reboot resolves the issue.
It is a pretty old question, but I have just encountered the same problem. In my case it occurred because I had more than one nuget package source configured in the Visual Studio Package Manager. In my company we use NuGet to get mainstream packages and MyGet for our own stuff.
When I attempted to pull a pretty big package it failed with a 503 code and the error link looked pretty odd, it had MyGet in it istead of NuGet. Turns out Visual Studio package manager tried to pull it from another source despite having NuGet chosen as a current source. Disabling other sources and then proceeding with a download fixed it.
Hopefully it will help somebody who stumbled upon this thread just like I did.
Another possible reason for recieving 503: If you're using Azure DevOps feed, then NuGet packages are limited to 500 MB.