问题
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
回答1:
change the folder name to Controllers and namespace to Controllers, so your code should look like this
namespace WebApplication1.Controllers
{
public class UserController : Controller
{
回答2:
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.
来源:https://stackoverflow.com/questions/48972148/controller-is-namespace-but-is-used-like-a-type