IdentityServer / IdentityServer4.Templates

dotnet new templates for IdentityServer4
Apache License 2.0
695 stars 229 forks source link

How to install IdentityServer4.Templates in Visual studio 2019 and .net core 3.1 cli? #73

Closed pradeep3221 closed 4 years ago

pradeep3221 commented 4 years ago

Question

How to install IdentityServer4.Templates in Visual studio 2019 and .net core 3.1 cli?

dotnet new -i identityserver4.templates

nothing happens when i run the command dotnet new -i identityserver4.templates and templates are not listed. image

image

leastprivilege commented 4 years ago

works on my machines.

dotnet new -i identityserver4.templates
  Restore completed in 685.74 ms for /Users/dominick/.templateengine/dotnetcli/v3.1.102/scratch/restore.csproj.

Usage: new [options]

Options:
  -h, --help          Displays help for this command.
  -l, --list          Lists templates containing the specified name. If no name is specified, lists all templates.
  -n, --name          The name for the output being created. If no name is specified, the name of the current directory is used.
  -o, --output        Location to place the generated output.
  -i, --install       Installs a source or a template pack.
  -u, --uninstall     Uninstalls a source or a template pack.
  --nuget-source      Specifies a NuGet source to use during install.
  --type              Filters templates based on available types. Predefined values are "project", "item" or "other".
  --dry-run           Displays a summary of what would happen if the given command line were run if it would result in a template creation.
  --force             Forces content to be generated even if it would change existing files.
  -lang, --language   Filters templates based on language and specifies the language of the template to create.
  --update-check      Check the currently installed template packs for updates.
  --update-apply      Check the currently installed template packs for update, and install the updates.

Templates                                                 Short Name               Language          Tags
------------------------------------------------------------------------------------------------------------------------------------------
Console Application                                       console                  [C#], F#, VB      Common/Console
Class library                                             classlib                 [C#], F#, VB      Common/Library
WPF Application                                           wpf                      [C#]              Common/WPF
WPF Class library                                         wpflib                   [C#]              Common/WPF
WPF Custom Control Library                                wpfcustomcontrollib      [C#]              Common/WPF
WPF User Control Library                                  wpfusercontrollib        [C#]              Common/WPF
Windows Forms (WinForms) Application                      winforms                 [C#]              Common/WinForms
Windows Forms (WinForms) Class library                    winformslib              [C#]              Common/WinForms
Worker Service                                            worker                   [C#]              Common/Worker/Web
Unit Test Project                                         mstest                   [C#], F#, VB      Test/MSTest
NUnit 3 Test Project                                      nunit                    [C#], F#, VB      Test/NUnit
NUnit 3 Test Item                                         nunit-test               [C#], F#, VB      Test/NUnit
xUnit Test Project                                        xunit                    [C#], F#, VB      Test/xUnit
Razor Component                                           razorcomponent           [C#]              Web/ASP.NET
Razor Page                                                page                     [C#]              Web/ASP.NET
MVC ViewImports                                           viewimports              [C#]              Web/ASP.NET
MVC ViewStart                                             viewstart                [C#]              Web/ASP.NET
Blazor Server App                                         blazorserver             [C#]              Web/Blazor
ASP.NET Core Empty                                        web                      [C#], F#          Web/Empty
IdentityServer4 with AdminUI                              is4admin                 [C#]              Web/IdentityServer4
IdentityServer4 with ASP.NET Core Identity                is4aspid                 [C#]              Web/IdentityServer4
IdentityServer4 Empty                                     is4empty                 [C#]              Web/IdentityServer4
IdentityServer4 with Entity Framework Stores              is4ef                    [C#]              Web/IdentityServer4
IdentityServer4 with In-Memory Stores and Test Users      is4inmem                 [C#]              Web/IdentityServer4
IdentityServer4 Quickstart UI (UI assets only)            is4ui                    [C#]              Web/IdentityServer4
ASP.NET Core Web App (Model-View-Controller)              mvc                      [C#], F#          Web/MVC
ASP.NET Core Web App                                      webapp                   [C#]              Web/MVC/Razor Pages
ASP.NET Core with Angular                                 angular                  [C#]              Web/MVC/SPA
ASP.NET Core with React.js                                react                    [C#]              Web/MVC/SPA
ASP.NET Core with React.js and Redux                      reactredux               [C#]              Web/MVC/SPA
Razor Class Library                                       razorclasslib            [C#]              Web/Razor/Library/Razor Class Library
ASP.NET Core Web API                                      webapi                   [C#], F#          Web/WebAPI
ASP.NET Core gRPC Service                                 grpc                     [C#]              Web/gRPC
dotnet gitignore file                                     gitignore                                  Config
global.json file                                          globaljson                                 Config
NuGet Config                                              nugetconfig                                Config
Dotnet local tool manifest file                           tool-manifest                              Config
Web Config                                                webconfig                                  Config
Solution File                                             sln                                        Solution
Protocol Buffer File                                      proto                                      Web/gRPC

Examples:
    dotnet new mvc --auth Individual
    dotnet new viewstart
    dotnet new --help
gbjbaanb commented 4 years ago

doesn't work on my machines either - dotnet new -i in the template dir produces the results with the is4 templates.

Change directory and try "dotnet new -l" returns a list, without the is4 templates.

leastprivilege commented 4 years ago

I am pushing a new version today. Maybe that fixes the problems.

nhonoskywalker commented 4 years ago

What are the requirements to make it work? It does not work for me.

Shoogn commented 4 years ago

It does not work for me.

MrTomZed commented 4 years ago

It does not work for me either. And I can't seem to get any tutorial working that starts from the ground up :(

headygains commented 4 years ago

Yeah I also cannot get the templates to install. However it appears that it is related to 401 auth errors to the nuget repos.

chassq commented 4 years ago

Same issue for me

C:\Users>dotnet new -i IdentityServer4.Templates
  Determining projects to restore...
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp1.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\.templateengine\dotnetcli\v5.0.100-rc.1.20452.10\scratch\restore.csproj]
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='IdentityServer4.Templates'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 401 (Logon failed.).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='IdentityServer4.Templates'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 401 (Logon failed.).
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\NuGet.targets(130,5): error : Failed to retrieve information about 'IdentityServer4.Templates' from remote source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='IdentityServer4.Templates'&semVerLevel=2.0.0'. [C:\Users\.templateengine\dotnetcli\v5.0.100-rc.1.20452.10\scratch\restore.csproj]
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\NuGet.targets(130,5): error :   Response status code does not indicate success: 401 (Logon failed.). [C:\Users\.templateengine\dotnetcli\v5.0.100-rc.1.20452.10\scratch\restore.csproj]
MrTomZed commented 4 years ago

You can manually download the samples from https://github.com/IdentityServer/IdentityServer4 ->Samples/Quickstart and start from there. For the most part those samples are what you create in the official tutorials: https://identityserver4.readthedocs.io/en/aspnetcore1/quickstarts/1_client_credentials.html

MasonThornberg commented 4 years ago

I had the same issue, but was able to resolve it by specifying the most current version, found here:

https://www.nuget.org/packages/IdentityServer4.Templates

dotnet new --install IdentityServer4.Templates::4.0.1

mchiaramonte commented 3 years ago

A little late to this one, but I just noticed that this only works if you're running the command in a Windows command prompt that's running as administrator. Figured I'd add this here so someone else might find this in the future and not waste their time.