Search code examples
c#identityserver4

Installing Identity Server 4 Templates


I am an Identity Server 4 Newbie attempting to follow the Identity Server 4 documentation. As instructed, I execute the following command:

C:\Windows\System32>dotnet new -i IdentityServer4.Templates

I then see the following errors

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]

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

status code does not indicate success: 401 (Unauthorized).

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

I am running the command prompt as administrator, and I have tried it a couple times as some answers have suggested.

Here is my nuget.confi info:

  <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>

Solution

  • It looks like the second package source (xxxxLibrary) is throwing a 401 for some reason. It might be an expired token, but you might try removing it temporarily to see if your dotnet new ... command succeeds (then put it back after).