在 Arch linux 中从终端创建 dotnet(.Net) 项目时出错

Posted

技术标签:

【中文标题】在 Arch linux 中从终端创建 dotnet(.Net) 项目时出错【英文标题】:getting errors while crating dotnet(.Net) project from terminal in arch linux 【发布时间】:2021-06-30 04:19:48 【问题描述】:

我刚刚安装了 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 应用程序?

【问题讨论】:

【参考方案1】:

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

【讨论】:

以上是关于在 Arch linux 中从终端创建 dotnet(.Net) 项目时出错的主要内容,如果未能解决你的问题,请参考以下文章

在一行中从linux终端发送邮件[关闭]

linux/arch jdk8安装

Arch Linux 终端升级zsh(oh my zsh)

Vmware Station安装Arch Linux

ARCH Linux pacman 包管理器出错总结

Linux下Oracle10