ASP.NET MVC命名空间重新命名 [英] ASP.NET MVC Namespace renaming

查看:167
本文介绍了ASP.NET MVC命名空间重新命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重新命名的项目从MyProjectName到MyNewProjectName。我做了一个完整的查找/于溶液替换,改变了测试项目以及。在Default.aspx.cs获得带有InvalidOpterationException

I renamed my project from MyProjectName to MyNewProjectName. I did a complete find/replace on the solution and changed the test project aswell. In Default.aspx.cs I get an InvalidOpterationException with

控制器名称'家'是以下类型之间的暧昧:
MyNewProjectName.Controllers.HomeController
MyProjectName.Controllers.HomeController。

"The controller name 'Home' is ambiguous between the following types: MyNewProjectName.Controllers.HomeController MyProjectName.Controllers.HomeController."

我要如何解决呢?谢谢

推荐答案

你试过重建(右键单击项目,并选择重建)?还要检查垃圾桶,以确保仅使用新名称的程序集是存在的。此外,仔细检查项目属性来验证程序集的名称被输出。如果你不知道什么是输出组件的名称,从仓删除所有的DLL和重建。

Have you tried to rebuild (right click on project, and select "Rebuild")? Also check the bin to make sure only the assembly with the new name is there. Also, double check the project properties to verify the name of the assembly is outputted. If you're not sure what the name of the outputted assembly is, delete all the dlls from bin and rebuild.

这篇关于ASP.NET MVC命名空间重新命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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