简体   繁体   English

MVC5已移动控制器,MVC仍在搜索旧路径

[英]MVC5 moved Controller, MVC still searches old path

I had a HomeController in /controllers/admin and all was working fine I moved HomeController to /controllers it finds the controller but still on its old path. 我在/controllers/admin有一个HomeController,并且一切正常,我将HomeController移到了/controllers它找到了控制器,但仍在其旧路径上。

I should be expecting /home/index but what I am (still) getting is /home/admin/index . 我应该期待/home/index但我(仍然)得到的是/home/admin/index How Can I stop this or fix this as I need the path to be correct as the app uses the path to build menus and apply other logic. 当应用需要使用正确的路径来构建菜单和应用其他逻辑时,我该如何停止或解决此问题。

I have removed the .Admin from the namespace declaration but where else is ths kind of information stored 我已经从命名空间声明中删除了.Admin ,但是这些信息还存储在什么地方

Hi all really weird this one. 大家好,这真的很奇怪。 In desperation I deleted the HomeController (copied the actions to notepad). 无奈之下,我删除了HomeController(将操作复制到记事本中)。 Stop and restart VS2013. 停止并重新启动VS2013。 Open and rebuilt the project. 打开并重建项目。 Create a new HomeController and pasted the actions back in. Ran it and now working as expected. 创建一个新的HomeController并将其粘贴回。运行它,现在可以按预期工作。

I have no clue what broke it and no clue what fixed it. 我不知道是什么弄坏了它,也不知道是什么解决了它。 All I know is its working. 我所知道的是它的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM