gpt4 book ai didi

.net-core - dotnet 错误 : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/

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

重现步骤

dotnet 构建或 dotnet 运行

预期行为

运行或构建应用程序

实际行为

Getting ready...
The template "ASP.NET Core with Angular" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /home/limup/Documents/Projetos/Limup/salao/salao.csproj...
/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' for operations on '/home/limup/Documents/Projetos/Limup/salao/obj/salao.csproj.nuget.cache'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' will allow NuGet to continue. [/home/limup/Documents/Projetos/Limup/salao/salao.csproj]

Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'

环境数据

dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961

Runtime Environment:
OS Name: fedora
OS Version: 31
OS Platform: Linux
RID: fedora.31-x64
Base Path: /usr/share/dotnet/sdk/3.1.101/

Host (useful for support):
Version: 3.1.1
Commit: a1388f194c

.NET Core SDKs installed:
3.1.101 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

观察

尝试修复 dotnet restore,但我收到了同样的错误。

dotnet sdk 2.0 没有这个问题。

最佳答案

就我而言,问题是由“锁定文件”(在 Linux 中)的所有权引起的。
我在运行 dotnet build在我的用户下(没有 sudo)但我的项目是使用 sudo 创建的.
选项 A)
再次使用 sudo

sudo dotnet build
选项 B)
更改/tmp/NuGetScratch/lock/所有权:
sudo chown -R <user>:<user> /tmp/NuGetScratch/
然后,用户可以运行 dotnet build没有sudo。

关于.net-core - dotnet 错误 : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59756017/

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