Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jason Walters 10 posts 121 karma points
    Jan 29, 2020 @ 01:37
    Jason Walters
    0

    Trouble setting up Umbraco Forms 7.2 fails with Template or Macro in RTE (InsertUmbracoForm.cshtml Line 16)

    So I have been having a heck of a time getting Umbraco Forms working.

    Currently Running: Umbraco 7.15.3 Umbraco Forms v7.2

    Initially, I could never get the trial working it sat dormant for quite a few upgrades which I think contributed to some problems. So I opted to purchase for the domain. Looking forward to getting it working, but I keep running into issues. One was the Partial View Macro InsertUmbracoForm was missing. I uninstalled, reinstalled with no luck. I manually created it. Though there are a few revisions floating around on various videos and forum posts, I believe I have the last known version. Then I had an issue with no Macro. I created the Macro manually but I was missing the correct FormGuid parameter. Anyway, eventually I was able to follow allow with the videos relating to the necessary script includes. Although I navigated these initial hurdles, I can't seem to get past this last stumbling block.

    Whether I try to add the form to a Template, or embedded with a macro using the RTE, I get the same error:

    Error loading Partial View script (file: ~/Views/MacroPartials/InsertUmbracoForm.cshtml)

    My Log (below) File seems to imply a missing System.Web.Helpers, but it is there in the bin folder. Double checked that it's referenced in Web Config.

        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
    

    I'm at a bit of a loss.

    Thanks, Jason

     2020-01-28 20:09:58,190 [P1756/D2/T179] WARN  umbraco.macro - Error loading Partial View (file: ~/Views/MacroPartials/InsertUmbracoForm.cshtml). Exception: System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.Web.HttpCompileException (0x80004005): C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\87c3d0a9\cbbe962f\App_Web_form.cshtml.b66a646f.s1qlykx1.0.cs(39): error CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'Microsoft.Web' (are you missing an assembly reference?)
       at System.Web.Compilation.AssemblyBuilder.Compile()
       at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
       at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
       at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
       at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
       at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
       at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath)
       at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
       at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
       at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass5_0.<Wrap>b__0()
       at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
       at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
       at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
       at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
       at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
       at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
       at System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, Object routeValues)
       at ASP._Page_Views_MacroPartials_InsertUmbracoForm_cshtml.Execute() in D:\inetpub\wwwroot\explore-live\Views\MacroPartials\InsertUmbracoForm.cshtml:line 16
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
       at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
       at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content)
       at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
       at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
    
  • Jason Walters 10 posts 121 karma points
    Feb 06, 2020 @ 23:12
    Jason Walters
    100

    Although no one has responded to this, I believe I solved the issue.

    So having been through many, many upgrades of Umbraco over time, it seems that some of the web.config files in some of the sub-folders, such as on in ~/Views/Partials have been abandoned. Up until using forms their existence was trivial, and had no impact. But it would seem that because of their age they referenced namespaces that no longer exist, like Microsoft.Web and Helpers.

    Removing any unnecessary web.config files cleared up the error, and now Forms functions.

  • Andy Shokry 5 posts 75 karma points
    Feb 27, 2020 @ 21:19
    Andy Shokry
    0

    Hi Jason,

    How did you add the missing macro? I just installed Umbraco forms as well and it's not showing in the Macros list.

    Thanks, ~Andy

  • Jason Walters 10 posts 121 karma points
    Feb 27, 2020 @ 23:24
    Jason Walters
    0

    Hey Andy!

    So I'm not crazy. The training videos kept referring to using the macro, but it wasn't there.

    What I did, was create a Macro called InsertUmbracoForm and then in the MVC Partial View filename field referenced the file that should have been there. I had the InsertUmbracoFormWithTheme but not InsertUmbracoForm

    ~/Views/MacroPartials/InsertUmbracoForm.cshtml I checked off Use in RTE & the Grid, and Render in RTE & Grid.

    Then from the source code, I "guessed" which parameters were needed based on what references I saw. The Alias & Name of: FormGuid, with a type of Form Picker

    For me it was not, but I'll post the source below. There were multiple versions of this source I saw, one in the videos and several here in the forums. I picked what I suspect is the latest one.

    InsertUmbracoForm.cshtml:

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    
    
    
    @if (Model.MacroParameters["FormGuid"] != null)
    {
        var s = Model.MacroParameters["FormGuid"].ToString();
        var g = new Guid(s);
    
        var recordGuid = Guid.Empty;
    
        if (string.IsNullOrEmpty(Request.QueryString["recordId"]) == false)
        {
            Guid.TryParse(Request.QueryString["recordId"], out recordGuid);
        }
        Html.RenderAction("Render",     "UmbracoForms", new {formId = g, recordId = recordGuid, mode = "form"});
        //Html.RenderAction("RenderForm", "UmbracoForms", new {formId = g, recordId = recordGuid, mode = "form"});
    }
    

    enter image description here

    enter image description here

    Hope this helps... Thanks, Jason

  • Andy Shokry 5 posts 75 karma points
    Feb 28, 2020 @ 04:11
    Andy Shokry
    0

    Perfect! Worked like a charm! Thanks, Jason! I can't believe they shipped a paid product half-baked like this!

Please Sign in or register to post replies

Write your reply to:

Draft