Reputation: 107
When i create new controller always throw an error "Controller'] is namespace but is used like a type".I dont know how to fix it i hve install the package.enter image description here
Upvotes: 6
Views: 9863
Reputation: 301
you have created folder name as controller that stop inherit Controller class so please change your folder name controller to controllers.
It work for me.
Upvotes: 4
Reputation: 622
change the folder name to Controllers and namespace to Controllers, so your code should look like this
namespace WebApplication1.Controllers
{
public class UserController : Controller
{
Upvotes: 25