简体   繁体   中英

Creation of ASP.NET users in console application

I am currently looking to build a console app to interact with a .NET webservice and insert AspNetUsers into my database.

I'm currently using this: https://www.codepoc.io/blog/net-core/5291/create-aspnetcore-identity-users-using-console-application

As a guide. However, I'm a little confused when it comes to the various dependencies required to successfully run the aforementioned code.

My workspace currently looks like this:

在此处输入图片说明

Am I correct in assuming that I may have the wrong version of AspNetCore? Am I missing something else or is this blog post out of date now? What would the best way be to insert .NET Identity users into the database using a .NET core console app - I'm equally not opposed to keeping it as a .NET Framework? Console app.

Any guidance appreciated.

I think Microsoft.AspNetCore.Identity.dll is its own dll which you can download via nuget from here . Please add that nuget package to your solution. Microsoft.AspNetCore is a different dll that does not contain the Microsoft.AspNetCore.Identity namespace which is why you are getting the error and not able to resolve the reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM