"AllowAnonymous" not found

Everything worked fine until I installed the (package manager console) mail package, then uninstalled and installed the older version.

Now I get an error when it has not been before. Error:

The type or namespace name 'AllowAnonymous' could not be found (are you missing a using directive or an assembly reference?)

Who knows how to fix this?

+4
source share
2 answers

Perhaps you are missing a build reference System.Web.Httpin your project?

So you need to:

  • Add a link to System.Web.Http;
  • Add using System.Web.Http;to your controller;

To add a link, you need to do the following:

  • node .
  • System.Web.Http .
  • System.Web.Http "".

" "

+3

. MVC 5 , MVC 3! :

PM> update-package
+1

Source: https://habr.com/ru/post/1545858/


All Articles