Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi Team

I have created Startup.cs file, but i have an error 'ApplicationSignInManager could not be found'. How do i solve this error, below is what i attempted so far.

What I have tried:

C#
<pre>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
using eNtsaTrainingRegistration.Models;

namespace eNtsaTrainingRegistration
{
    public partial class Startup
    {
        public void ConfigureAuth(IAppBuilder app)
        {
            app.CreatePerOwinContext(ApplicationDbContext.Create);
            app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
        }
    }
}


// IdentityConfig.cs
public class ApplicationSignInManager:SignInManager<ApplicationUser, string>
     {
         public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager)
         : base(userManager, authenticationManager)
         {
         }

         public override Task<ClaimsIdentity> CreateUserIdentityAsync(ApplicationUser user)
         {
             return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager);
         }

         public static ApplicationSignInManager Create(IdentityFactoryOptions<ApplicationSignInManager> options, IOwinContext context)
         {
             return new ApplicationSignInManager(context.GetUserManager<ApplicationUserManager>(), context.Authentication);
         }
     }
Posted
Updated 27-Feb-20 2:04am
Comments
Richard MacCutchan 27-Feb-20 7:54am    
Given your previous question today, are you sure the namespaces are correct?
gcogco10 27-Feb-20 7:56am    
Yes they are, what I did just now, first removed all dll under bin folder, clean and build solution. Still error, its still there so now im stuck. Usually issue its about using incorrect assembly, checked its correct.
jimmson 27-Feb-20 9:05am    
In what namespace do you have ApplicationSignInManager class? What is the name of this namespace?
gcogco10 27-Feb-20 9:06am    
Mate I end up figure it out as you mentioned, googling it and find the answer and errors are gone. https://stackoverflow.com/questions/60433327/applicationsigninmanager-could-not-be-found/60434510#60434510 Richard you can close this thread mate.
jimmson 27-Feb-20 9:15am    
Good! :)
Questions on CodeProject are not closed, they can only be solved (as far as I know).
I deleted my answer because I made a mistake, your problem was slightly different than I thought. Sorry about that mate.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900