After 10 years when someone will ask me , where the hell i learn all basic vital things from in the beginning of my learning phase . No doubt i'm gonna mention this channel. Thankyou
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.IUserStore`1[Microsoft.AspNetCore.Identity.IdentityUser]' while attempting to activate 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]'.
public readonly RoleManager RoleManager; public readonly UserManager UserManager; public AdministrationController(RoleManager RoleManager, UserManager UserManager) { this.UserManager = UserManager; this.RoleManager = RoleManager; } you have to add this to the top of your document. It looks like in this tutorial he left out a few things :/
Hello Kaspervdh - Very glad you find it useful. Thank you for taking the time to leave your valuable feedback. Means a lot. I have included all the .NET Core MVC tutorial videos, slides and text articles in logical order on the following page. Hope will find it handy. www.pragimtech.com/courses/angular-6-tutorial-for-beginners/ If you have time, can you please rate and write your valuable feedback on the reviews tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.
Wessam Elsheikh there are plenty of third party reporting systems. I would look at them. I made the mistake of writing my own that generated HTML and output PDF. I ended up buying dev express the reports took me 1/10th of the time to put together
Thank you sir.your teaching sence is awesome. sir I have a question, I make project in asp.net core in which there are two projects one is api and another is mvc.In which I create login method using UserManager in api that process i pass all user data into mvc that case I can't receive data . now what I can do? can you have any tips for this problem?
I'm getting this InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[VacationManagerDemo.Data.Models.User]' while attempting to activate 'VacationManagerDemo.Controllers.AccountController'. Can someone help me with fixing it?
chillowHD 1 second ago public readonly RoleManager RoleManager; public readonly UserManager UserManager; public AdministrationController(RoleManager RoleManager, UserManager UserManager) { this.UserManager = UserManager; this.RoleManager = RoleManager; } you have to add this to the top of your document. It looks like in this tutorial he left out a few things :/
Is there a way to create an entry (a user) in another Asp.Net Identity Database from another Project other than creating a user in the current Asp.Net Identity? Basically, in my ASP.NET CORE (main) app I want to create some customer users that would be stored in another Identity Database, other than the "ROOT" application - like to say. Thank you!
Hi, Whenever I am calling any method of SignInManager Class. It is throwing an exception: Invalid Object Name 'AspNetUserClaims'. Actually I have not created AspNetUserClaims table while migration as I dont need AspNetUserClaims table. Please can someone help me
How can I validate my Email? I dont have my email on my Model class its the default email from IdentityUser its on AspNetUsers Table, I cannot change it using [Parameters]
it doesnt work at all, asp .net wants default constructor without additional parameters for it. and if i dont create such constructor then i get System.MissingMethodException when i enter View()
do we need to add anything else? I am getting errors when going to the registration page. InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' while attempting to activate 'Mathly.Controllers.AccountController'. Do i need to provide identtiyUser service on start up or async services
In Startup.cs file, please check if you are passing ApplicationUser type as the generic argument to AddIdentity() method services.AddIdentity(options => { options.Password.RequiredLength = 10; options.Password.RequiredUniqueChars = 3; options.SignIn.RequireConfirmedEmail = true; }) .AddEntityFrameworkStores() .AddDefaultTokenProviders(); In AccountController constructor, please check if ApplicationUser type is passed as the argument to both UserManager and SignInManager. public AccountController(UserManager userManager, SignInManager signInManager, ILogger logger) { this.userManager = userManager; this.signInManager = signInManager; this.logger = logger; } Would love to know if you have managed to fix the error.
At 2:33 How and where is this constructor invoked? Someone needs to actually pass this method the UserManager and SignInManager parameters right? How are these parameters passed when the controller is constructed during routing?
Hello Robbe - Great question. Yes, you are right, someone needs to pass instances of UserManager and SignInManager to the controller. With the built-in dependency injection support in .NET core we no longer have to use the new keyword and instantiate the dependencies ourselves. This is automatically done by the built-in dependency injection system in .NET core. We discussed dependency injection in Part 19 of this video series. The following is the link, if you want to check it out. Hope this answers your question. ruclips.net/video/BPGtVpu81ek/видео.html I have included all the MVC core tutorial videos, slides and text articles in sequence on the following page. Hope you will find it handy. www.pragimtech.com/courses/asp-net-core-mvc-tutorial-for-beginners/ When you have some time, can you please leave your rating and valuable feedback on the REVIEWS tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.
Hi, I've followed your tutorial through-out and checked my code regularly, I have ran into a issue though. When I press on the "Register" page in the NAV, the following error pops up. An unhandled exception occurred while processing the request. InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' while attempting to activate 'ProjectApplicationX00140684.Controllers.AccountController'. Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired) Any advice on how I could fix this ?
I think I 've run into a similar error, you need to register the services in Startup.cs/ConfigureServices() method: //1- register IdentityDBContext services.AddDbContext(options => options.UseSqlServer( context.Configuration.GetConnectionString("IdentityDBConnection"), x => x.MigrationsAssembly("WebApplication1") ) ); //2- register the defaultIdentity: services.AddDefaultIdentity(options => options.SignIn.RequireConfirmedAccount = true) .AddRoles().AddEntityFrameworkStores();
Hi Venkat, I don't understand why are we copying the data from the incoming RegisterViewModel object into the IdentityUser object ??? var user = new IdentityUser { UserName = model.Email, Email = model.Email };
RegisterViewModel is a Model class which won't have a table in the database. It will just provide the fields like username or email, password, confirm password, etc. in the form. So if we copy the values from RegisterViewModel it will be easier to use. And somehow I feel like this is a good practice. We should not directly copy data or values into Models that are directly connected to the database. I hope I helped. And if I am wrong please correct me, since I am learning as well. Thank you.
this is creating an enumerator of IdentityUser Type which then gets saves into the database. The enumerator makes is easy for the database to sort and save as a less complex object. Its proper programming technique. You can google enumerators
Thank you for your input. I have a question turns out that I am using identity for user identification. I register my users and log in the first time but when I want to make a new login I get the message Invalid login Attempt. Then finding out I found that it is not allowed as a username because the @ is included, but I want to keep my username as email. Another solution I found but it does not seem the most correct is changing in the database the EmailConfirmed column to true to true. on the other hand probe put in my starup file the following code options.SignIn.RequireConfirmedEmail = true; But neither The problem is that the PasswordSignInAsync method shows as a result Not Allowed can you help me with any solution?
10:01 If someone can get unauthorized access to this table, they probably can get access to other tables, and they wouldn't need to know the passwords anyway because all other data are in plain text! 😂😂😂😂
After 10 years when someone will ask me , where the hell i learn all basic vital things from in the beginning of my learning phase . No doubt i'm gonna mention this channel. Thankyou
You are talented. Your are one of the best teachers out there, you are helping out many. thanks for your hardwork .
I don''t know what to say....hats off your dedication towards student learning...love you teching style explantion every thing....From @Pakistan
Thank you sir for this series God bless you ,
Gotta say, your voice is very pleasant and calms me down.
Thank you so much for all of this work. You have a real talent for teaching.
Thank you for this series.. well described content
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.IUserStore`1[Microsoft.AspNetCore.Identity.IdentityUser]' while attempting to activate 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]'.
public readonly RoleManager RoleManager;
public readonly UserManager UserManager;
public AdministrationController(RoleManager RoleManager,
UserManager UserManager)
{
this.UserManager = UserManager;
this.RoleManager = RoleManager;
}
you have to add this to the top of your document. It looks like in this tutorial he left out a few things :/
services.AddIdentity()
.AddEntityFrameworkStores(); add this path in your startup.cs class.
You are good . Thank you 🥺🙏
Thanks you for uploading these series sir.
simply you are the beast!!
Great
2:29 holy... Never knew you could do this hahah.
Hello Kaspervdh - Very glad you find it useful. Thank you for taking the time to leave your valuable feedback. Means a lot. I have included all the .NET Core MVC tutorial videos, slides and text articles in logical order on the following page. Hope will find it handy.
www.pragimtech.com/courses/angular-6-tutorial-for-beginners/
If you have time, can you please rate and write your valuable feedback on the reviews tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.
perfect and nice thanks a lot have a nice day :)
Hello
@@tinytutor413 welcome
thankyou very much for this great work
Hi body, i need to know how we can make Reports in ASP.NET Core
Wessam Elsheikh there are plenty of third party reporting systems. I would look at them. I made the mistake of writing my own that generated HTML and output PDF. I ended up buying dev express the reports took me 1/10th of the time to put together
Thank you sir.your teaching sence is awesome. sir I have a question, I make project in asp.net core in which there are two projects one is api and another is mvc.In which I create login method using UserManager in api that process i pass all user data into mvc that case I can't receive data . now what I can do? can you have any tips for this problem?
Bro nullreference exception.. while hiting create async.. I check parameter.. username and email it came
I'm getting this InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[VacationManagerDemo.Data.Models.User]' while attempting to activate 'VacationManagerDemo.Controllers.AccountController'. Can someone help me with fixing it?
chillowHD
1 second ago
public readonly RoleManager RoleManager;
public readonly UserManager UserManager;
public AdministrationController(RoleManager RoleManager,
UserManager UserManager)
{
this.UserManager = UserManager;
this.RoleManager = RoleManager;
}
you have to add this to the top of your document. It looks like in this tutorial he left out a few things :/
ostoura
Is there a way to create an entry (a user) in another Asp.Net Identity Database from another Project other than creating a user in the current Asp.Net Identity? Basically, in my ASP.NET CORE (main) app I want to create some customer users that would be stored in another Identity Database, other than the "ROOT" application - like to say. Thank you!
Why Venkat does not use "if else" for returning views or result succeed or error. Is there reason for not using it?
I followed this tutorial but there aren't any cookies in the browser. Where are you setting cookies up exactly?
Can any one please explain why are passing ApplicationUser type as the generic argument to AddIdentity() method? Thank you
Hi,
Whenever I am calling any method of SignInManager Class. It is throwing an exception: Invalid Object Name 'AspNetUserClaims'.
Actually I have not created AspNetUserClaims table while migration as I dont need AspNetUserClaims table.
Please can someone help me
hai sir what is the open source saml 2.0 for identity server 4.0 .net core
How can I validate my Email? I dont have my email on my Model class its the default email from IdentityUser its on AspNetUsers Table, I cannot change it using [Parameters]
I have an 405 not allowed error. No an 404. I´m using NEtCore 3.1
same here 😃
i wonder why dont you use ApplicationUser instead of identityUser. you have used earlier video ApplicationUser: IdentityUser.
How can we add to project an e-mail confirmation in order to complete registration?
Hello Senol - We will discuss email confirmation and 2 factor authentication in our upcoming videos. Please stay tuned.
it doesnt work at all, asp .net wants default constructor without additional parameters for it. and if i dont create such constructor then i get System.MissingMethodException when i enter View()
do we need to add anything else? I am getting errors when going to the registration page.
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' while attempting to activate 'Mathly.Controllers.AccountController'.
Do i need to provide identtiyUser service on start up or async services
In Startup.cs file, please check if you are passing ApplicationUser type as the generic argument to AddIdentity() method
services.AddIdentity(options =>
{
options.Password.RequiredLength = 10;
options.Password.RequiredUniqueChars = 3;
options.SignIn.RequireConfirmedEmail = true;
})
.AddEntityFrameworkStores()
.AddDefaultTokenProviders();
In AccountController constructor, please check if ApplicationUser type is passed as the argument to both UserManager and SignInManager.
public AccountController(UserManager userManager,
SignInManager signInManager,
ILogger logger)
{
this.userManager = userManager;
this.signInManager = signInManager;
this.logger = logger;
}
Would love to know if you have managed to fix the error.
At 2:33 How and where is this constructor invoked? Someone needs to actually pass this method the UserManager and SignInManager parameters right? How are these parameters passed when the controller is constructed during routing?
Hello Robbe - Great question. Yes, you are right, someone needs to pass instances of UserManager and SignInManager to the controller. With the built-in dependency injection support in .NET core we no longer have to use the new keyword and instantiate the dependencies ourselves. This is automatically done by the built-in dependency injection system in .NET core. We discussed dependency injection in Part 19 of this video series. The following is the link, if you want to check it out. Hope this answers your question.
ruclips.net/video/BPGtVpu81ek/видео.html
I have included all the MVC core tutorial videos, slides and text articles in sequence on the following page. Hope you will find it handy.
www.pragimtech.com/courses/asp-net-core-mvc-tutorial-for-beginners/
When you have some time, can you please leave your rating and valuable feedback on the REVIEWS tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.
How to identify that how many users are log in / registered???
Please anyone can reply
Hi, I've followed your tutorial through-out and checked my code regularly, I have ran into a issue though.
When I press on the "Register" page in the NAV, the following error pops up.
An unhandled exception occurred while processing the request.
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' while attempting to activate 'ProjectApplicationX00140684.Controllers.AccountController'.
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)
Any advice on how I could fix this ?
I think I 've run into a similar error, you need to register the services in Startup.cs/ConfigureServices() method:
//1- register IdentityDBContext
services.AddDbContext(options =>
options.UseSqlServer(
context.Configuration.GetConnectionString("IdentityDBConnection"),
x => x.MigrationsAssembly("WebApplication1")
)
);
//2- register the defaultIdentity:
services.AddDefaultIdentity(options => options.SignIn.RequireConfirmedAccount = true)
.AddRoles().AddEntityFrameworkStores();
Hi Venkat, I don't understand why are we copying the data from the incoming RegisterViewModel object into the IdentityUser object ???
var user = new IdentityUser
{
UserName = model.Email,
Email = model.Email
};
RegisterViewModel is a Model class which won't have a table in the database. It will just provide the fields like username or email, password, confirm password, etc. in the form. So if we copy the values from RegisterViewModel it will be easier to use. And somehow I feel like this is a good practice. We should not directly copy data or values into Models that are directly connected to the database. I hope I helped. And if I am wrong please correct me, since I am learning as well. Thank you.
because CreatAsync method accept only an object of type IdentityUser. So if you didn't do that it will show you an error (red line) that is it simply
Hello Mohsin - Thank you for answering the question. Your correct. Really appreciate your help.
Hello MM - Thank you for taking the time to answer this question and help others. Great, straight to the point and clear.
this is creating an enumerator of IdentityUser Type which then gets saves into the database. The enumerator makes is easy for the database to sort and save as a less complex object. Its proper programming technique. You can google enumerators
I have this exception. "Unable to resolve services for type microsoft.aspnetcore.identify.userManager
did you find a solution
?
same here
@@r1ndamangg I did find one! Go to startup.cs and change services.AddIdentity(); to services.AddIdentity().AddEntityFrameworkStores();
Can you make a video of sql replication sir,thanks
is anyone facing issue with password complexity ? password complexity is not working for me.
var result =null so null reference error comes
Thank you for your input. I have a question turns out that I am using identity for user identification. I register my users and log in the first time but when I want to make a new login I get the message Invalid login Attempt. Then finding out I found that it is not allowed as a username because the @ is included, but I want to keep my username as email. Another solution I found but it does not seem the most correct is changing in the database the EmailConfirmed column to true to true. on the other hand probe put in my starup file the following code options.SignIn.RequireConfirmedEmail = true; But neither The problem is that the PasswordSignInAsync method shows as a result Not Allowed can you help me with any solution?
Dear sir what are claims and how to do pagination
how to decrypt the password from the database table?
10:01 If someone can get unauthorized access to this table, they probably can get access to other tables, and they wouldn't need to know the passwords anyway because all other data are in plain text! 😂😂😂😂