Copied to clipboard

Flag this post as spam?

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


  • Mayank 14 posts 44 karma points
    Jan 07, 2017 @ 08:04
    Mayank
    0

    'PublishedContentModels' does not exist in the namespace 'Umbraco.Web'

    Umbraco 7.3.5 installed via NuGet VS 2015

    Umbraco backend working but unable to load frontend pages.

    Getting following Error :

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0234: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.Web' (are you missing an assembly reference?)


    Error From log :

    ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred System.Web.HttpCompileException (0x80004005): c:\Users\Mayank\AppData\Local\Temp\Temporary ASP.NET Files\vs\e37dfa4f\78bad723\AppWebroot.cshtml.65a2d1ee.uocj3x7m.0.cs(34): error CS0234: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.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.Compilation.BuildManager.GetCompiledType(String virtualPath) at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetCompiledType(String 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.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>cDisplayClass21.<>cDisplayClass2b.


    This type of issue is linked with model builder but 7.3.5 should not have model builder with it .

    Solution Neededenter image description here

    Thanks !

  • marc goodson 587 posts 3612 karma points MVP 3x c-trib
    Jan 07, 2017 @ 11:14
    marc goodson
    0

    Hi Mayank

    Is this a fresh install or an existing implementation ?

    I'm wondering how the view (App_Web_root.cshtml) has gotten a reference to using Umbraco.Web.PublishedContentModels ?

    If the site isn't meant to work with ModelsBuilder or Zbu Models builder package for pre 7.4.x I'd remove any using statements that reference Umbraco.Web.PublishedContentModels...

    and then I'd delete the contents of the folder 78bad723 from your Temporary ASP Files

    c:\Users\Mayank\AppData\Local\Temp\Temporary ASP.NET Files\vs\e37dfa4f\78bad723

    to make sure they are freshly generated...

    .. see if the error returns after rebuilding.

    regards

    Marc

  • Asbjørn 71 posts 162 karma points c-trib
    Nov 30, 2017 @ 15:05
    Asbjørn
    0

    This could be due to ~/Views/web.config having a reference to the namespace (I believe it is in there by default):

    <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="Umbraco.Web" />
        <add namespace="Umbraco.Core" />
        <add namespace="Umbraco.Core.Models" />
        <add namespace="Umbraco.Web.Mvc" />
        <add namespace="umbraco" />
        <add namespace="Examine" />
        <add namespace="Umbraco.Web.PublishedContentModels" />        
      </namespaces>
    </pages>
    

  • MDum 6 posts 35 karma points
    26 days ago
    MDum
    0

    Does someone can explain why I need a Umbraco.Web.PublishedContentModels.dll in my bin directory, and so why it is not part of Umbraco releases?

  • OleP 22 posts 113 karma points
    24 days ago
    OleP
    0

    The .dll is made by the models builder in Umbraco. The models builder will convert your document types into strongly typed models for you to use in your application. If the Umbraco.ModelsBuilder.ModelsMode setting in your web.config is set to dll or LiveDll, the PublishedContentModels.dll will appear in your bin directory.

    Read more about the models builder here: https://our.umbraco.com/documentation/reference/templating/modelsbuilder/

Please Sign in or register to post replies

Write your reply to:

Draft