gpt4 book ai didi

asp.net-mvc - 自更新 NuGet 包以来,VS 一直需要重启

转载 作者:行者123 更新时间:2023-12-04 16:49:13 25 4
gpt4 key购买 nike

我从模板创建了一个全新的 C# Web 应用程序,并立即更新了它的所有 NuGet 包。

更新过程中需要重启,之后一直提示:

One or more packages could not be completely uninstalled: Newtonsoft.Json.6.0.4. Restart Visual Studio to finish uninstall.

但在重新启动 Visual Studio 后,相同的消息仍然存在。

enter image description here

packages.config 文件包含以下行:<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" /> .

最佳答案

尝试在包管理器控制台中手动更新包后,我收到一条错误消息,指出现有文件正在阻止安装。从解决方案包中删除适当的文件夹后,错误消失了,我可以直接从包管理器 UI 更新包。

这是我的控制台打印:

PM> update-package -reinstall Newtonsoft.Json
Removing 'Newtonsoft.Json 6.0.4' from MyProject.
Successfully removed 'Newtonsoft.Json 6.0.4' from MyProject.
Uninstalling 'Newtonsoft.Json 6.0.4'.
update-package : TF400024: The change on D:\Users\Shimmy\Documents\Visual Studio
2012\Projects\MyProject\MyProject\packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll cannot be undone because a file already
exists at D:\Users\Shimmy\Documents\Visual Studio
2012\Projects\MyProject\MyProject\packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll. The file must be deleted from disk for
the undo to succeed.
At line:1 char:1
+ update-package -reinstall Newtonsoft.Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Update-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.UpdatePackageCommand

'Newtonsoft.Json 6.0.4' already installed.
Adding 'Newtonsoft.Json 6.0.4' to MyProject.
Successfully added 'Newtonsoft.Json 6.0.4' to MyProject.
One or more packages could not be completely uninstalled: Newtonsoft.Json.6.0.4. Restart Visual Studio to finish uninstall.

关于asp.net-mvc - 自更新 NuGet 包以来,VS 一直需要重启,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28853053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com