3

I have been using VS for Mac for a while. But I always getting the following warning messages in my views:

'HtmlHelper' doesn't contain a definition for 'ActionLink' and not accessible extension method 'ActionLink' accepting a first argument of type 'HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

enter image description here

Same thing happens for other controls: BeginForm, AntiForgeryToken, Partial, etc...

enter image description here

These are the settings I have in the ./View/Web.config:

enter image description here

...and this for the Web.config at the solution level:

enter image description here

I have been doing a search how to solve this and following this link Razor Views not seeing System.Web.Mvc.HtmlHelper , but not luck as of now. Any help or clue how to fix this?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
MikePR
  • 2,786
  • 5
  • 31
  • 64
  • 2
    Delete the `bin` and `obj` folders of the projects and rebuild. Error should go away. – TanvirArjel Apr 06 '19 at 06:48
  • 1
    Please post the code instead of images of code. See [Why are images of text, code and mathematical expressions discouraged?](https://meta.stackexchange.com/questions/320052/why-are-images-of-text-code-and-mathematical-expressions-discouraged/320060#320060) for an explanation. – Super Jade Apr 07 '19 at 04:55

1 Answers1

0

These steps worked for MVC 5.2.7:

  1. Create a new MVC web application from Visual Studio
  2. Copy the Web.config configuration from the Views folder over to your working application's Views folder and do the same for the root web.config
  3. Also ensure your MVC project file (.proj file) has the following after TargetFrameworkVersion element <MvcBuildViews>false</MvcBuildViews>

After following these steps, intellisense began to work.

CarenRose
  • 1,266
  • 1
  • 12
  • 24
Kevon
  • 43
  • 7