Click here to Skip to main content
15,922,696 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAn unhandled exception occurred while processing the constructor in ASP.NET Core MVC Pin
Alex Dunlop6-Dec-21 7:51
Alex Dunlop6-Dec-21 7:51 
I use the following code for dependency injection of Register/Login controller. The problem is that I cannot use Repository pattern I have created previously.

private readonly UserManager<AppUser> _userManager;
        private readonly SignInManager<AppUser> _signInManager;
        private readonly IUserRepository _userRepository;

        public HomeController(UserManager<AppUser> userManager, SignInManager<AppUser> signInManager, IUserRepository userRepository)
        {
            _userManager = userManager;
            _signInManager = signInManager;
            _userRepository = userRepository;
        }


When I run the code, the following error is occured:

Quote:
InvalidOperationException: Unable to resolve service for type 'CustomizedIdentity.Repositories.IUserRepository' while attempting to activate 'CustomizedIdentity.Controllers.HomeController'.


modified 6-Dec-21 14:00pm.

AnswerRe: An unhandled exception occurred while processing the constructor in ASP.NET Core MVC Pin
Richard Deeming6-Dec-21 21:54
mveRichard Deeming6-Dec-21 21:54 
GeneralRe: An unhandled exception occurred while processing the constructor in ASP.NET Core MVC Pin
Alex Dunlop7-Dec-21 7:09
Alex Dunlop7-Dec-21 7:09 
QuestionUse Active Directory for authentication Pin
Joseline Riker2-Dec-21 5:50
Joseline Riker2-Dec-21 5:50 
QuestionIs this data annotation correct for date and time? Pin
Alex Dunlop25-Nov-21 22:26
Alex Dunlop25-Nov-21 22:26 
AnswerRe: Is this data annotation correct for date and time? Pin
Richard MacCutchan26-Nov-21 0:02
mveRichard MacCutchan26-Nov-21 0:02 
GeneralRe: Is this data annotation correct for date and time? Pin
Alex Dunlop26-Nov-21 0:28
Alex Dunlop26-Nov-21 0:28 
GeneralRe: Is this data annotation correct for date and time? Pin
Richard MacCutchan26-Nov-21 0:39
mveRichard MacCutchan26-Nov-21 0:39 
GeneralRe: Is this data annotation correct for date and time? Pin
Alex Dunlop26-Nov-21 0:45
Alex Dunlop26-Nov-21 0:45 
GeneralRe: Is this data annotation correct for date and time? Pin
Richard MacCutchan26-Nov-21 0:56
mveRichard MacCutchan26-Nov-21 0:56 
AnswerRe: Is this data annotation correct for date and time? Pin
jkirkerx28-Nov-21 9:12
professionaljkirkerx28-Nov-21 9:12 
QuestionCannot establish local connection to SQL SERVER Pin
Alex Dunlop24-Nov-21 23:15
Alex Dunlop24-Nov-21 23:15 
QuestionRe: Cannot establish local connection to SQL SERVER Pin
Richard MacCutchan25-Nov-21 0:37
mveRichard MacCutchan25-Nov-21 0:37 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
Richard Deeming25-Nov-21 1:15
mveRichard Deeming25-Nov-21 1:15 
GeneralRe: Cannot establish local connection to SQL SERVER Pin
Richard MacCutchan25-Nov-21 1:18
mveRichard MacCutchan25-Nov-21 1:18 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
Richard Deeming25-Nov-21 1:19
mveRichard Deeming25-Nov-21 1:19 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
jsc4225-Nov-21 2:56
professionaljsc4225-Nov-21 2:56 
GeneralRe: Cannot establish local connection to SQL SERVER Pin
Richard Deeming25-Nov-21 3:33
mveRichard Deeming25-Nov-21 3:33 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
Alex Dunlop25-Nov-21 9:02
Alex Dunlop25-Nov-21 9:02 
Questioncall a server side Powershell script? Pin
Joseline Riker19-Nov-21 6:44
Joseline Riker19-Nov-21 6:44 
AnswerRe: call a server side Powershell script? Pin
Richard Deeming21-Nov-21 22:52
mveRichard Deeming21-Nov-21 22:52 
GeneralRe: call a server side Powershell script? Pin
Joseline Riker3-Dec-21 7:34
Joseline Riker3-Dec-21 7:34 
GeneralRe: call a server side Powershell script? Pin
Richard Deeming5-Dec-21 21:43
mveRichard Deeming5-Dec-21 21:43 
QuestionIs it possible to use SQLite instead of MSSQL SERVER in ASP.NET projects? Pin
Alex Dunlop17-Nov-21 21:29
Alex Dunlop17-Nov-21 21:29 
AnswerRe: Is it possible to use SQLight instead of MSSQL SERVER in ASP.NET projects? Pin
Richard Deeming17-Nov-21 21:45
mveRichard Deeming17-Nov-21 21:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.