Can't install IdentityServer4.Template

Viewed 776

Why I can't install IdentityServer4 template using dotnet new --install IdentityServer4.Templates::4.0.1?

When I run the command it does not show any errors, it just shows the list of templates I have. I checked my Windows user NuGet configuration and there seems nothing wrong with it.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear/>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="IdentityServer Local" value="./nuget" />
  </packageSources>
</configuration>

I've also tried using this command dotnet new -i identityserver4.templates --nuget-source https://api.nuget.org/v3/index.jsonbut it does not work either.

2 Answers

I still didn't have the solution to the problem but I found a workaround by downloading the nuget package file of the IdentityServer Template. Then I run dotnet new -i <path>\identityserver4.templates.4.0.1.nupkg.

Check the path (eg. 'C:\Users\username.templateengine\packages' for windows) where the identityserver4.template already exist and delete it. You can now install idp.

Related