【发布时间】:2010-12-27 14:22:59
【问题描述】:
我正在尝试重构现有的 asp.net-mvc Web 应用程序并引入 mvc-turbine。
该应用程序按原样运行,但我想让它更具可插拔性和可维护性,以便将来的维护更容易。
我想我会尽量减少重构步骤,所以我参考了 MvcTurbine、MvcTurbine.Unity 和 MvcTurbine.Web。
然后我让 global.asax.cs 中的 MvcApplication 看起来像这样:
Public class MvcApplicatoin : TurbineApplication{
static MvcApplication(){
ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator());
Application_Start();
}
<snip of all code that hasn't changed/>
}
我意识到调用 Application_Start 不是应该的方式,但这会使第一步的更改尽可能小。
当我现在运行时,我看到控制器中的代码被命中并正确运行。然后我的观点正在呈现。我可以遍历每一行,那里也没有问题。然后结果会显示在浏览器中:乱码。
������í½I%&/mÊ{JõJ×àt¡$Ø@ìÁÍæìiG#)«*ÊeVe]f@Ìí¼÷Þ{ï½÷Þ
等等,一整页。
在没有 Turbine 的情况下我没有遇到过这个问题,我在之前的测试中也没有遇到任何问题,我会从一开始就引入 Turbine。
关于如何开始调试的任何想法?
【问题讨论】:
标签: c# asp.net-mvc refactoring turbine