Copied to clipboard

Flag this post as spam?

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


  • Craig100 1136 posts 2523 karma points c-trib
    Oct 30, 2012 @ 23:13
    Craig100
    0

    Help, working dev setup broken by upgrade

    Removed WebMatrix 1 and installed WebMatrix 2 (Refresh). Loaded a previously working Umbraco 4.7.2 site which now won't run it's razor macros.  Using ?umbDebugShowTrace I get an error similar to this one for each macro that won't run:-

    umbracoMacro Loading IMacroEngine script    0.0434314987501275 0.000020
    umbracoMacro Error Loading Razor Script (file: Get Home Page Slider Images) ":" is not valid at the start of a code block.  Only identifiers, keywords, comments, "(" and "{" are valid.
       at System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode()
      at System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType()
      at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
      at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
      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.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
      at System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String virtualPath)
      at System.Web.WebPages.VirtualPathFactoryExtensions.CreateInstance[T](IVirtualPathFactory factory, String virtualPath)
      at System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String virtualPath)
      at System.Web.WebPages.VirtualPathFactoryExtensions.CreateInstance[T](IVirtualPathFactory factory, String virtualPath)
      at System.Web.WebPages.WebPageBase.CreateInstanceFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory)
      at umbraco.MacroEngines.RazorMacroEngine.CompileAndInstantiate(String virtualPath)
      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
      at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage) 0.0442811173494082 0.000850
    umbracoMacro Loading IMacroEngine script [done]

    I also updated my VS2010 t with MVC4 and razor extensions. Loading the same site into that, it shows syntax errors that are not highlighted by Umbraco as the same code is running right now on a live server.

    Can anyone help me get this my dev setup working again? I've lost over day on this already. Can't afford much more!

    Thanks.

     

  • Craig Noble 41 posts 584 karma points c-trib
    Oct 31, 2012 @ 00:35
    Craig Noble
    0

    Hi Craig,

    A shot in the dark, can you confirm umbraco.MacroEngines.dll and umbraco.macroRenderings.dll in the bin are exactly the same as before?

    Also, just curious, would you be able to show us the razor code you are trying to load?  The stack trace doesn't seem to break until it tries to load the Razor Script.  Is it only that script that you are getting the problems?  Have you tried rendering a blank template with another razor script?

    Cheers,

    Craig

  • Craig100 1136 posts 2523 karma points c-trib
    Oct 31, 2012 @ 12:52
    Craig100
    0

    Hi Craig (!),

    Thanks for your suggestions, the dll versions you mention are the same on the dev and live machines, I just checked.

    In the meantime, as I was in a panic last night, I posed a similar question with razor code on Stackoverflow. They reckon it's a compilation issue in Razor and have raised a bug with their team: http://stackoverflow.com/questions/13146452/umbraco-razor-syntax-issue.  I'll raise this on the Umbraco Dev mailling list in case there are knock-on effects.  

    As I was given a workaround (see the stackoverflow link for details) I have nearly all the macros working now apart from one (though it's a bit like peeling an onion, as one is fixed another is revealed!). It's just very alarming that you can lose days of work with no warning through an apparently simple upgrade:(

    Cheers,

    Craig

Please Sign in or register to post replies

Write your reply to:

Draft