Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Controller is a namespace but is used like a type.

$
0
0

with this code

usingMicrosoft.AspNetCore.Mvc;namespaceProjectNetCore.Controllers{publicclassHomeController:Controller{publicIActionResultIndex(){returnView();}}}

I'm getting this message when I try to compile the project:"'Controller' is a namespace but is used like a type", the word"Controller" is flagged as an error and show an error in the "View()" call: "The name "View" does not exists in the current context".

I've been having this error just since last thursday with the last update of the C# Visual Studio Code extension...


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>