Have a look at the usings on top of the source code.
This error can occur if you do not have
using Microsoft.AspNetCore.Mvc;
there.
The compiler then is not able to resolve "View".
Also have a look at your solution.
You must have the Framework "Microsoft.AspNetCore.App" referenced.
Another issue could be that you did not derive HomeController from the Microsoft.AspNetCore.Mvc.Controller class. So verify if
ControllerBase
derives from it.