0

I'm having a problem where various methods aren't working in the usermanager. I tried clearing my Resharper cache and even turning off resharper completely, but the error msg is the same even without resharper running. It insists that these methods don't exist. They work fine in all other MVC projects, except the one I'm working on.

When I hover over one of the methods it's giving me the basic "missing using directive or assembly reference". It doesn't give me an option to import and all the imports seem to be as they should, yet my project won't acknowledge these methods.

Got any clue on how to fix this issue?

As you can see it's like various methods doesn't even exist and if I disable resharper the normal error system just takes over and gives the same rror.

Code as text:

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using MEV3.Models.Helpers;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Owin.Security;
using MEV3.Models;

As you can see all my imports are correct.

[HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = await UserManager.FindByNameAsync(model.Email);
                if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id)))
                {
                    // Don't reveal that the user does not exist or is not confirmed
                    return View("ForgotPasswordConfirmation");
                }

                var code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);
                var callbackUrl = Url.Action("ResetPassword", "Account",
                new { UserId = user.Id, code = code }, protocol: Request.Url.Scheme);
                await UserManager.SendEmailAsync(user.Id, "Reset Password",
                "Please reset your password by clicking here: <a href=\"" + callbackUrl + "\">link</a>");
                return View("ForgotPasswordConfirmation");
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }
ObedMarsh
  • 433
  • 4
  • 19
  • So, are you "missing using directive or assembly reference"? Maybe `Microsoft.AspNet.Identity`? – zafeiris.m Mar 13 '15 at 16:16
  • Did you read my question properly? Yes I have all the required using statements and my project still does not recognize the methods. As i already explained. – ObedMarsh Mar 13 '15 at 16:23
  • Its not new that there are issue with template have you tried removing and adding assembly manually? – Sandip Bantawa Mar 13 '15 at 16:27
  • @ObedMarsh All right dude, calm down, it's friday. It has happened million times that I miss the assembly reference (or a redirect binding to the correct version of the dll) and I get this error. You could check if any of these are different to your other projects. – zafeiris.m Mar 13 '15 at 16:38
  • I am completely calm but your suggestions are obvious and I already tried them. The imports are the same in other projects. @brykneval No I havent, how do I do it exactly? – ObedMarsh Mar 13 '15 at 16:40
  • its on reference, and might be on packages later to add manually, and yes I have been through some silly template problem. Even clean template gives some wierd errors unless you redo it – Sandip Bantawa Mar 13 '15 at 17:09
  • What the entire project?! We worked on it for over 4 months, no way. – ObedMarsh Mar 13 '15 at 18:00

0 Answers0