visual-studio - nuget dll 被另一个进程使用

标签 visual-studio json.net nuget nuget-package nuget-package-restore

我收到下面的错误,但我完全不知道如何解决它。到目前为止已尝试以下操作:

  1. 清理 bin/obj/packages/packages 缓存
  2. 从 csproj 和 packages 文件中手动删除该包,然后添加它..仍然错误
  3. 更新 Visual Studio 2017
  4. 重新安装 Visual Studio 2017
  5. 跟踪哪些进程正在使用名称包含 Newtonsoft 的文件
  6. 从另一台笔记本电脑复制解决方案,构建工作正常

然而,毕竟从上面来看,我仍然得到:

Error       NuGet Package restore failed for project DriversApp.Android: Unable to find version '10.0.3' of package 'Newtonsoft.Json'.
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'Newtonsoft.Json.10.0.3' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
  https://api.nuget.org/v3/index.json: Error downloading 'Newtonsoft.Json.10.0.3' from 'https://api.nuget.org/v3-flatcontainer/newtonsoft.json/10.0.3/newtonsoft.json.10.0.3.nupkg'.
  The process cannot access the file 'C:\Users\user\.nuget\packages\newtonsoft.json\10.0.3\lib\netstandard1.0\Newtonsoft.Json.dll' because it is being used by another process.
. Please see Error List window for detailed warnings and errors.                

如何解决这个问题?我真的被这个问题困住了......

最佳答案

经过大量调查和想法后,我通过卸载防病毒解决方案解决了这个问题,因为我在笔记本电脑中添加的规则被公司服务器策略覆盖了。

总而言之,首先检查您的防病毒解决方案,如果您处于受控环境中,请确保您的规则不会被公司服务器策略覆盖。

感谢 @Leo Liu-MSFT 的帮助。

关于visual-studio - nuget dll 被另一个进程使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49202946/

相关文章:

c# - 以编程方式从 XML 模式生成测试 XML

entity-framework - 为包管理器迁移操作指定 "project name"

visual-studio - 在 Visual Studio 中查找不需要的库引用

c# - Json.Net 和 Monotouch 编译

c# - 获取数组 JSON.Net 的长度

c# - 如何解析来自 HttpClient 的 JSON 字符串?

visual-studio-2010 - 如何从 CruiseControl.Net 触发 NuGet v2.x 包还原

javascript - 使用 Node.js 访问 azure 表存储

nuget - Azure DevOps,在使用 website.sln 文件时恢复 "Visual Studio Build"的 NuGet 包

nuget - 如何使用 Visual Studio for Mac 将图标 URL 添加到我的 Nuget 包