'Controller' 是命名空间,但用作类型 [英] 'Controller' is namespace but is used like a type
本文介绍了'Controller' 是命名空间,但用作类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我创建新控制器时总是抛出错误Controller'] 是命名空间,但用作类型".我不知道如何修复它,我已经安装了该包.在此处输入图片描述
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,将namespace改为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
{
这篇关于'Controller' 是命名空间,但用作类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文