安装 Identity Server 4 模板

Mis*_*ive 1 c# identityserver4

我是 Identity Server 4 新手,尝试遵循 Identity Server 4 文档。按照指示,我执行以下命令:

C:\Windows\System32>dotnet new -i IdentityServer4.Templates
Run Code Online (Sandbox Code Playgroud)

然后我看到以下错误

C:\Program Files\dotnet\sdk\2.2.300\NuGet.targets(121,5): error : Unable to load the 

service index for source

https://pkgs.dev.azure.com/xxxxxx/_packaging/xxLibraries/nuget/v3/index.json.

[C:\Users\xxxx\.templateengine\dotnetcli\v2.2.300\scratch\restore.csproj]
Run Code Online (Sandbox Code Playgroud)

C:\Program Files\dotnet\sdk\2.2.300\NuGet.targets(121,5): error : Response

status code does not indicate success: 401 (Unauthorized).
Run Code Online (Sandbox Code Playgroud)

[C:\Users\xxxx\.templateengine\dotnetcli\v2.2.300\scratch\restore.csproj]

我以管理员身份运行命令提示符,并且按照一些答案的建议尝试了几次。

这是我的 nuget.conf 信息:

  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="xxxxLibrary" value="https://pkgs.dev.azure.com/xxxx/_packaging/xxxxLibraries/nuget/v3/index.json" />
    <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
  </packageSources>
Run Code Online (Sandbox Code Playgroud)

Mor*_*rdy 6

我遇到了类似的问题,但我可以通过附加 nuget 源参数来指定要使用的 nuget 源来解决它:

dotnet new -i identityserver4.templates --nuget-source https://api.nuget.org/v3/index.json
Run Code Online (Sandbox Code Playgroud)