Last post Mar 04, 2020 02:54 PM by bumples18
Mar 02, 2020 06:59 PM|bumples18|LINK
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)
Hi, I am trying to load a very simple register program. Below are the programs involved. I am using asp.net core mvc 3.0
Mar 03, 2020 04:11 AM|Sherry Chen|LINK
Hi bumples18 ,
AddIdentityCore adds the services that are necessary for user-management actions ( this boils down to registering an instance of
UserManager<TUser> ), such as creating users, hashing passwords, etc. Refer to the relevant
AddIdentity registers the same services as AddIdentityCore, with a few extras:
Refer to the relevant
Calling AddDefaultIdentity is similar to calling the following:
So change the below code line
services.AddIdentityCore<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
services //.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true) .AddIdentity<IdentityUser,IdentityRole>(options => options.SignIn.RequireConfirmedAccount = true) .AddDefaultUI() .AddDefaultTokenProviders();
Mar 03, 2020 06:19 PM|bumples18|LINK
Thank you for your help. I did what you said but I am getting a bootstrap error in the startup file. I reloaded bootstrap using NuGet but they said to use bower which I uploaded. Bower has a separate file bower_component.
The error in the startup is the following: object does not contain a definition for Bootstrap4 and no accessible extension method Bootstrap4 accepting a first argument of type object could not be found( are you missing a using directive or an assembly.
Under layout.tshtml I have
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
How do I resolve this problem?
Mar 04, 2020 09:41 AM|Sherry Chen|LINK
Actually , AddDefaultUI adds a default, self-contained UI for Identity to the application using Razor Pages in an area named Identity. You could remove it in mvc project and it has no effect. And bootstrap4 has been used since ASP.NET
Core 2.2 ,you could refer to
this blog .
So in your ConfigureServices, you could use
Mar 04, 2020 02:54 PM|bumples18|LINK
Thanks you very much for your help. That did the job. I have been using bootstrap for years and am using it now so not sure why I had the problem or told to use Bower.
I am not a programmer although I have been learning a lot, I have used the forums and they have helped me so much.