美文网首页
Nuget 包还原异常解决方案

Nuget 包还原异常解决方案

作者: 天天向上卡索 | 来源:发表于2019-02-22 20:16 被阅读0次

Nuget 包还原异常解决方案

Intro

有时候 nuget 包会还原异常,查看引用好多包都带着感叹号

Solution

打开 Package Manager Console ,选择有问题的项目 Project, 在 Package Manager Console 执行以下命令:

Update-Package -Reinstall

或者

Update-Package -Reinstall -Safe

这样就会重新安装包,并且有更新的还会安装更新,相对来说下面这种方式更好一些,避免出现更新之后有不兼容的类库导致代码编译失败。

原文:

Note you can force package restore to execute by running the following commands in the nuget package manager console

Update-Package -Reinstall

Forces re-installation of everything in the solution.

Update-Package -Reinstall -ProjectName myProj

Forces re-installation of everything in the myProj project.

Note: This is the nuclear option. When using this command you may not get the same versions of the packages you have installed and that could be lead to issues. This is less likely to occur at a project level as opposed to the solution level.

You can use the -safe commandline parameter option to constrain upgrades to newer versions with the same Major and Minor version component. This option was added later and resolves some of the issues mentioned in the comments.

Update-Package -Reinstall -Safe

Reference

相关文章

  • Nuget 包还原异常解决方案

    Nuget 包还原异常解决方案 Intro 有时候 nuget 包会还原异常,查看引用好多包都带着感叹号 Solu...

  • .net core (一):Hello world

    使用命令行创建项目: 备注: dotnet restore :在本地未安装Nuget时,还原Nuget包。 dot...

  • C# webapi 配置 swagger

    1.vs->工具->NuGet包管理器->管理解决方案的NuGet程序包 2.程序包源选择nuget.org,然后...

  • nuget 是如何还原包的

    nuget 是如何还原包的 Intro 一直以来从来都只是简单的用 nuget 包,最近想折腾一个东西,需要自己搞...

  • C# SQLite 数据库使用说明

    一、NuGet引入SQLite库 在VS菜单:工具→NuGet包管理器→管理解决方案的NuGet程序包 打开NuG...

  • 交易重复提交自动化工具

    WindowsFormApp1 思路 调用库 工具->NuGet包管理器->管理解决方案的NuGet程序包,安装几...

  • .NET CORE 集成 swagger

    1.vs版本2017--工具--NuGet包管理器--管理解决方案得NuGet程序包 2.搜索Swashbuckl...

  • 离线环境下还原 Nuget 包

    1. 使用环境 在某些企业内部生产环境下,服务器可能没有连接互联网,而项目的的第三方引用包可能并没有跟随发布到服务...

  • visual studio 2017中配置opengl的简单方式

    新建一个C++ 空项目; 工具-》NuGet包管理器-》管理解决方案的NuGet程序包image.png 搜索nu...

  • C#(.NET)打印PDF

    iTextSharp插件使用 ·安装NuGet包 选中工程右击——“管理NuGet程序包”,搜索安装“iTextS...

网友评论

      本文标题:Nuget 包还原异常解决方案

      本文链接:https://www.haomeiwen.com/subject/wfryyqtx.html