首页 > 解决方案 > 在 Arch linux 中从终端创建 dotnet(.Net) 项目时出错

问题描述

我刚刚安装了 dotnet、dotnet-runtime、vscode 来在我的 garuda Linux(它是一种 arch Linux)中构建 dotnet 应用程序。当我尝试使用命令“dotnet new counsole -o myfrist”从终端创建一个新项目时,我得到了这个输出。

╭─venkey at garuda0 in ⌁/Documents/vscode/snd
╰─λ dotnet new console -o fristapp
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on fristapp/fristapp.csproj...
  Determining projects to restore...
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3028: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3037: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature validity period has expired.
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3028: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The repository countersignature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
  Failed to restore /home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj (in 769 ms).
Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'

即使我执行了这个命令,我仍然收到以下错误。

╭─venkey at garuda0 in ⌁/Documents/vscode/snd/fristapp
╰─λ dotnet restore
  Determining projects to restore...
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3028: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3037: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature validity period has expired.
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3028: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The repository countersignature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
  Failed to restore /home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj (in 788 ms).

当我再次尝试运行代码时,我得到了这个错误。

╭─venkey at garuda0 in ⌁/Documents/vscode/snd/fristapp
╰─λ dotnet run
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3028: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3037: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature validity period has expired.
/home/venkey/Documents/vscode/snd/fristapp/fristapp.csproj : error NU3028: Package 'Microsoft.AspNetCore.App.Ref 5.0.0' from source 'https://api.nuget.org/v3/index.json': The repository countersignature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain

The build failed. Fix the build errors and run again.

出现错误,我无法创建任何 dotnet 应用程序,也无法运行 dotnet 应用程序。任何人都可以帮助解决这些错误并创建 dotnet 应用程序吗?

标签: c#.netlinux.net-core

解决方案


这是 ca-certificates-mozilla 软件包的问题。您可以通过降级来解决此问题。版本 3.62-1 有效。


推荐阅读