在Orchard中,Null Reference Exception尝试添加新的自定义表单

时间:2012-09-20 15:34:26

标签: asp.net asp.net-mvc orchardcms

在Orchard 1.51中,我正在尝试从“管理自定义表单”界面添加新的自定义表单(当前不存在任何表单)。我得到一个空引用异常。这类似于Cowboy Hell上个月发生的错误Orchard Create Featured Items Error。他跟进并关闭了这个问题:“数据库中存在问题。我删除它后再次部署它就可以了。”

听到这个消息我并不感到惊讶,但我有一个网站有很多内容和配置。我没有使用迁移来对数据库进行版本控制。该网站开始使用Orchard的版本,并已成功推出。

我一直在尝试添加“自定义表单”。禁用和重新启用自定义窗体模块不起作用。我没有看到任何干净的方法来完全从项目中删除它并重新添加它。我可以从文件系统中删除该模块,并删除一个专门引用自定义表单Orchard_CustomForms_CustomFormPartRecord的数据库表,但这让我很紧张。

    Object reference not set to an instance of an object. 
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an  object.

    Source Error: 


    Line 1:  @{
    Line 2:      var typeDisplayName = Model.ContentItem.TypeDefinition.DisplayName;
    Line 3:      var pageTitle = T("New {0}", typeDisplayName);
    Line 4:  
    Line 5:      Layout.Title = (string)pageTitle.Text;


    Source File: dev\Core\Contents\Views\Admin\Create.cshtml    Line: 3 

    Stack Trace: 

    [NullReferenceException: Object reference not set to an instance of an object.]
    Orchard.Localization.Text.Get(String textHint, Object[] args) in    
    \dev\src\Orchard\Localization\Text.cs:31
    CallSite.Target(Closure , CallSite , Localizer , String , Object ) +169
    ASP._Page_Core_Contents_Views_admin_Create_cshtml.Execute() in \dev\Core\Contents\Views\Admin\Create.cshtml:3
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +279
    System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +103
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +172
    Orchard.Mvc.ViewEngines.ThemeAwareness.<>c__DisplayClass7.<FindView>b__5(ViewContext  viewContext, TextWriter writer, IViewDataContainer viewDataContainer) in \dev\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:59
   Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutView.Render(ViewContext viewContext, TextWriter writer) in \dev\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:90
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +383
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +32
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter,      ResultExecutingContext preContext, Func`1 continuation) +825572

   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +825600
   System.Web.Mvc.Controller.ExecuteCore() +159
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in \dev\src\Orchard\Mvc\Routes\ShellRoute.cs:147
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375

0 个答案:

没有答案