为什么在我的MVC4的应用程序模板未修改code试图两次注册的地方? [英] Why is unmodified template code in my MVC4 app trying to register areas twice?

查看:142
本文介绍了为什么在我的MVC4的应用程序模板未修改code试图两次注册的地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我创建了在VS11公测MVC4互联网项目模板的新MVC4应用程序。现在,当我部署的应用程序到我的网站托管服务提供商,和我离开以下行活跃在我的Global.asax类,我得到的MVC的错误尝试注册一个已经存在的路线。当我注释掉这一行,一切都正常运行,但动作前往当地特定的控制器坏了,我问在<一个href=\"http://stackoverflow.com/questions/11531046/what-is-wrong-with-my-area-routing-in-my-bin-deployed-mvc4-app\">this问题。

  AreaRegistration.RegisterAllAreas();


解决方案

如果您在您的部署bin目录中的旧的DLL(如果您重命名你在某些时候项目或DLL),那么你会得到这个错误。

请确保在部署bin目录得到清洗。

I have a new MVC4 app that I create off the MVC4 internet project template in VS11 beta. Now when I deploy the app to my web site hosting provider, and I leave the following line active in my Global.asax class, I get an error about MVC trying to register a route that already exists. When I comment out this line, everything runs fine, but action links to area specific controllers are broken, as I ask about in this question.

AreaRegistration.RegisterAllAreas();

解决方案

If you have an old dll in your deployment bin directory (if you renamed your project or dlls at some point) then you'd get this error.

Make sure the bin directory is getting cleaned when you deploy.

这篇关于为什么在我的MVC4的应用程序模板未修改code试图两次注册的地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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