windows 无法运行dotnet还原

67up9zun  于 2022-12-14  发布在  Windows
关注(0)|答案(1)|浏览(328)

当我尝试在我的项目的根文件夹中运行dotnet restore时,我收到以下错误:

C:\Program Files\dotnet\sdk\7.0.100\NuGet.targets(676,5): error : Unable to obtain lock file access on 'C:\Users\user\AppData\Local\Temp\NuGetScratch\lock' fo
r operations on 'C:\Users\user\AppData\Roaming\NuGet\NuGet.Config'. This may mean that a different user or administrator is holding this lock and that this pr
rashed and left an inaccessible lock file, in this case removing the file 'C:\Users\user\AppData\Local\Temp\NuGetScratch\lock' will allow NuGet to continue. [ 
C:\Users\user\Documents\Kurs C#\FirstProject\FirstProject\FirstProject.csproj]

我在Microsoft文档中找到的解决方案都不起作用。我在这里找到了一个可能的解决方案:Dotnet commands fail when restoring Nuget packages in shell script但是,我应该如何更改这些权限?

qxsslcnc

qxsslcnc1#

以管理员身份运行VS代码会有所帮助,但这仍然只是一个变通办法。

相关问题