Ubuntu dotnet 用户机密

Ubuntu dotnet user-secrets

我在 Ubuntu v16.04 上安装了 dotnet 核心。问题是当我尝试使用 dotnet user-secrets 它说: No executable found matching command "dotnet-user-secrets"

dotnet 核心版本: 1.0.0-preview2-003131

dotnet 截图:

要在 .NET Core 中使用 Secret Manager,您必须将其安装到项目中:

  1. 将行 Microsoft.Extensions.SecretManager.Tools 添加到 project.json
  2. tools 部分
  3. 运行 dotnet restore

您可以在 official .NET documentation 中找到有关它的更多信息。

当我通过 nuget 添加该包时,它会将其添加到 "dependencies" 部分。所以我不得不移动下面的行:

"Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final"

从 "dependencies" 部分进入 project.json 文件的 "tools" 部分。然后我 运行 dotnet restore 然后它工作了。只需确保 运行 这些命令位于 project.json 文件所在的同一目录中。