Bhautik Dalicha
Bhautik Dalicha

Reputation: 107

'Controller' is namespace but is used like a type

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

Answers (2)

yogesh lodha
yogesh lodha

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

Saad Qais
Saad Qais

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

Related Questions