TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gcobani Mkontwana
566
1.9k
406k
The type or namespace ApplicationSignInManager could not be
Feb 25 2020 12:18 AM
Hi Team
I have this error ' The namespace or type ApplicationSignInManager, ApplicationUserManager, ApplicationRoleManager could not be found, missing some directive'. The problem is i do have the relevant assemblies but i am still getting this issue and did clean as well built my applicatio. Please help me mates to resolve this issue.
// HomeController
using
System;
using
eNtsaTrainingRegistration.Models;
using
Microsoft.AspNet.Identity.Owin;
using
System.IO;
using
System.Configuration;
using
System.Net.Http;
using
System.Net.Http.Headers;
using
System.Text.RegularExpressions;
using
System.Threading.Tasks;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.Mvc;
using
eNtsaTrainingRegistration.Helper;
using
eNtsaTrainingRegistration.App_Start;
namespace
eNtsaTrainingRegistration.Controllers
{
[HandleError(ExceptionType =
typeof
(Exception), View =
"InternalError"
)]
public
class
HomeController : AppBaseController
{
// GET: Home
private
ApplicationSignInManager _signInManager;
private
ApplicationUserManager _userManager;
private
ApplicationRoleManager _roleManager;
public
HomeController()
{
}
public
HomeController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, ApplicationRoleManager roleManager)
{
UserManager = userManager;
SignInManager = signInManager;
AppRoleManager = roleManager;
}
public
ApplicationSignInManager SignInManager
{
get
{
return
_signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
}
private
set
{
_signInManager = value;
}
}
public
ApplicationUserManager UserManager
{
get
{
return
_userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
}
private
set
{
_userManager = value;
}
}
public
ApplicationRoleManager AppRoleManager
{
get
{
return
_roleManager ?? Request.GetOwinContext().GetUserManager<ApplicationRoleManager>();
}
private
set
{
_roleManager = value;
}
}
[AuthorizeRole(Roles =
"SuperAdmin, AdminUser, PendingUSers"
)]
[OutputCache(NoStore =
true
, Duration = 0, VaryByParam =
"None"
)]
public
ActionResult Index()
{
var pendingUserRoleId = AppRoleManager.Roles.SingleOrDefault(r => r.Name ==
"PendingUsers"
).Id;
var pendingUsers = (from user
in
UserManager.Users
select
new
{
UserId = user.Id,
Username = user.FirstName,
Useremail = user.Email,
UserroleId = user.Roles.FirstOrDefault().RoleId,
EmailConf = user.EmailConfirmed,
})
.Where(u => u.UserroleId == pendingUserRoleId)
.Where(u => u.EmailConf ==
true
)
.Select(p =>
new
RoleViewModel()
{
});
return
View(pendingUsers);
}
protected
override
void
Dispose(
bool
disposing)
{
if
(_userManager !=
null
)
{
_userManager.Dispose();
_userManager =
null
;
}
if
(_signInManager !=
null
)
{
_signInManager.Dispose();
_signInManager =
null
;
}
if
(_roleManager !=
null
)
{
_roleManager.Dispose();
_roleManager =
null
;
}
base
.Dispose(disposing);
}
}
}
Reply
Answers (
12
)
How do create Date from time (hh:mm) and bind with Datetime
form for printed page