Copied to clipboard

Flag this post as spam?

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


  • Nick 97 posts 514 karma points
    Apr 01, 2023 @ 11:25
    Nick
    0

    Umbraco 11 Cloud : Forms error

    Hi,

    Wondered if anybody could help me with Umbraco forms on my Cloud instance. I have created a form called Apply Vacancy and created a new template using the files here https://docs.umbraco.com/umbraco-forms/developer/themes using the Umbraco 11 Default theme, I haven't changed anything in the code except for the template name, just wanted the form to work brfore changing any styling but receive the below errors, can anybody shed any light on were I am going wrong?

    enter image description here

    Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.CompilationFailedException: One or more compilation failures occurred:
    C:\home\site\wwwroot\Views\Partials\Forms\Emails\saietta-email-template.cshtml(76,11): error CS0103: The name 'media' does not exist in the current context
    C:\home\site\wwwroot\Views\Partials\Forms\Emails\saietta-email-template.cshtml(157,32): error CS1061: 'FormsHtmlModel' does not contain a definition for 'HeaderHtml' and no accessible extension method 'HeaderHtml' accepting a first argument of type 'FormsHtmlModel' could be found (are you missing a using directive or an assembly reference?)
    C:\home\site\wwwroot\Views\Partials\Forms\Emails\saietta-email-template.cshtml(161,41): error CS1061: 'FormsHtmlModel' does not contain a definition for 'HeaderHtml' and no accessible extension method 'HeaderHtml' accepting a first argument of type 'FormsHtmlModel' could be found (are you missing a using directive or an assembly reference?)
    C:\home\site\wwwroot\Views\Partials\Forms\Emails\saietta-email-template.cshtml(243,32): error CS1061: 'FormsHtmlModel' does not contain a definition for 'FooterHtml' and no accessible extension method 'FooterHtml' accepting a first argument of type 'FormsHtmlModel' could be found (are you missing a using directive or an assembly reference?)
    C:\home\site\wwwroot\Views\Partials\Forms\Emails\saietta-email-template.cshtml(247,41): error CS1061: 'FormsHtmlModel' does not contain a definition for 'FooterHtml' and no accessible extension method 'FooterHtml' accepting a first argument of type 'FormsHtmlModel' could be found (are you missing a using directive or an assembly reference?)
       at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RuntimeViewCompiler.CompileAndEmit(RazorCodeDocument codeDocument, String generatedCode)
       at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RuntimeViewCompiler.CompileAndEmit(String relativePath)
       at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RuntimeViewCompiler.OnCacheMiss(String normalizedPath)
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultRazorPageFactoryProvider.CreateFactory(String relativePath)
       at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.CreateCacheResult(HashSet`1 expirationTokens, String relativePath, Boolean isMainPage)
       at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.LocatePageFromPath(String executingFilePath, String pagePath, Boolean isMainPage)
       at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.GetView(String executingFilePath, String viewPath, Boolean isMainPage)
       at Umbraco.Cms.Web.Website.ViewEngines.ProfilingViewEngine.GetView(String executingFilePath, String viewPath, Boolean isMainPage)
       at Microsoft.AspNetCore.Mvc.ViewEngines.CompositeViewEngine.GetView(String executingFilePath, String viewPath, Boolean isMainPage)
       at Umbraco.Forms.Web.Extensions.ControllerExtensions.RenderViewAsync[TModel](Controller controller, String viewPath, TModel model)
       at Umbraco.Forms.Core.Providers.WorkflowTypes.SendRazorEmail.ParseWithRazorView(Record record, String razorViewFilePath)
       at Umbraco.Forms.Core.Providers.WorkflowTypes.SendRazorEmail.Execute(WorkflowExecutionContext context)
    

    Many thanks again for all your support on my Umbraco journey :-)

  • Brendan Rice 538 posts 1102 karma points
    Apr 02, 2023 @ 20:48
    Brendan Rice
    100

    It sounds like the models builder is out of sync and need to regenerate the models again.

    Here's a link to the official docs: https://docs.umbraco.com/umbraco-cms/reference/templating/modelsbuilder

    The 'media' error suggest import at the top of the file.

Please Sign in or register to post replies

Write your reply to:

Draft