aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.96k stars 868 forks source link

Can't scaffold identity in new project. #1748

Closed natelaff closed 6 years ago

natelaff commented 6 years ago

Using 2.1 Preview 2.

Following directions from blog post, want to scaffold identity using the command dotnet aspnet-codegenerator identity -dc WebApplication1.Data.ApplicationDbContext

I receive this error: dotnet : No executable found matching command "dotnet-aspnet-codegenerator"

What does my csproj file need to look like to find this command? I've tried installing all sorts of packages and adding tools but can't get it to work. What's this supposed to look like?

blowdart commented 6 years ago

@javiercn who owns this bit?

javiercn commented 6 years ago

@seancpeters Owns this.

I think the blog post might be missing instructions. If I remember correctly, the scaffolder is a global tool now. So it needs to be installed with dotnet intall tool dotnet-aspnet-codegenerator --version 2.1.0-preview2-final" @natemcmaster can confirm

natemcmaster commented 6 years ago

I'm not sure of the answer here, but dotnet-aspnet-codegenerator was cut from preview2 due to issues in the global tools feature in the CLI. We hope to ship it in RC

javiercn commented 6 years ago

@natemcmaster Ah, you are right. @blowdart Who wrote the documentation for this? @danroth27?

In any case, I'll figure out what to do here.

HaoK commented 6 years ago

You should be able to go thru Add New Scaffolded Item -> Identity

danroth27 commented 6 years ago

You have to add scaffolding as a DotNetCliToolReference. If you run the Identity scaffolder from VS it will take care of that for you. In Preview1 we didn't have the VS experience so the command-line was your only option, but our main focus is on the VS experience.

danroth27 commented 6 years ago

To see how to add the DotNetCliToolReference, add the following item in your project file:

<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
natelaff commented 6 years ago

Ahhh. Yep, it's there and worked great. I suppose an updated Preview 2 blog post will go into such a thing when posted, but that Preview 1 one was all I had to work on :) Thanks