如何卸载不可用的 nuget 包? [英] How do I uninstall a nuget package that is not available?

查看:170
本文介绍了如何卸载不可用的 nuget 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的项目移到一台新机器上,但无法访问旧机器上本地存储的名为 SBD.Common 的旧 nuget 包.

I have moved my project to a new machine and do not have access to an old nuget package called SBD.Common that was stored locally on the old machine.

我想从项目中卸载包当我使用 Manage Nuget Packages 解决方案时,我可以看到该包已安装但在此源中不可用.

I want to uninstall the package from the project When I use Manage Nuget Packages for solution I can see that the package is installed but not available in this source.

当我点击卸载按钮时出现错误

When I click the Uninstall button I get an error

An error occured while trying to restore the packages" Unable to find version '1.0.0' of 'SBD.Common'

c:\Program files(x86)\Microsoft SDKS\NugetPackages\:Package 'SBD.Common.1.0.0' is not found on source 'C:\Program Files(x86)\Microsoft SDKs\NuGetPackages\' 
https://api.nuget.org/v3/index.json:Package 'SBD.Common.1.0.0' is not found

如何告诉我的项目我不想在无法访问包的情况下恢复该包?

How do I tell my project that I don't want to restore this package without gaining access to the package?

这是我的 Nuget.Config,位于 C:\Users\MyName\AppData\Roaming\NuGet

Here is my Nuget.Config at C:\Users\MyName\AppData\Roaming\NuGet

   <?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <disabledPackageSources>
    <add key="Microsoft and .NET" value="true" />
  </disabledPackageSources>
  <packageRestore>
    <add key="enabled" value="False" />
    <add key="automatic" value="False" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
</configuration>

我使用的是 Nuget 版本 3.4.4.1321

I am using Nuget version 3.4.4.1321

推荐答案

问题是我在packages.config中列出了文件

the problem was that I had the files listed in packages.config

这篇关于如何卸载不可用的 nuget 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆