“控制器"是名称空间,但其使用方式类似于类型 [英] 'Controller' is namespace but is used like a type

查看:58
本文介绍了“控制器"是名称空间,但其使用方式类似于类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建新的控制器时,总是抛出错误"Controller']是名称空间,但像类型一样使用".我不知道如何解决它,我已经安装了软件包. stack.imgur.com/f9ODS.jpg"rel =" nofollow noreferrer>在此处输入图片描述

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

推荐答案

将文件夹名称更改为Controllers,将名称空间更改为Controllers,因此您的代码应如下所示

change the folder name to Controllers and namespace to Controllers, so your code should look like this

namespace WebApplication1.Controllers
{
   public class UserController : Controller
   {

这篇关于“控制器"是名称空间,但其使用方式类似于类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆