1

I have created an ASP.NET MVC 5 project. In one of the controllers I am using,

[Authorize(Roles = "Admin")]

for accessing the Index action, which should Authorize only the members of Admin role to access it. However, when I run my application I get the error message,

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'

At this point I should mention that I have created an Admin user who is member of Admin role. Also, when I run my application with

[Authorize(Users = "Admin")]

it works fine, but this is not what I want. I am currently using VS 2013 and my database is localDB.

Can anyone help with this issue?

tereško
  • 58,060
  • 25
  • 98
  • 150
nick316igr
  • 21
  • 1
  • 3
  • Is this a brand new MVC 5 project? And, if so, can you update all of the packages and try again? OR did you update an existing ASP MVC project? – Alex Dresko Dec 05 '13 at 01:18
  • 1
    It is a brand new MVC 5 project and all my packages are updated. – nick316igr Dec 05 '13 at 01:24
  • That stored procedure is from the old membership providers. Are you using the old membership providers instead of the new ASP.NET Identity? What does your web.config look like? – Kevin Junghans Dec 12 '13 at 19:19
  • 1
    I have a similar problem where my [Authorize(Users="")] works but [Authorize(Roles="")] does not. It just redirects me to the log in page. – Josh Jan 31 '14 at 23:42

1 Answers1

0

I had a same problem.

Open your solution

  1. right click your solution and nu-get package manager
  2. Search and Find JQuery library (Although your project has it, add it again)
  3. Add to solution
  4. Clean solution
  5. Rebuild solution

then the control starts to work.

hasanaydogar
  • 885
  • 11
  • 24