Copied to clipboard

Flag this post as spam?

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


  • Isaiah Pellarp 19 posts 73 karma points
    Jan 08, 2021 @ 14:16
    Isaiah Pellarp
    0

    Compilation Error: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.Web'

    I am running a website using umbraco 8 and modelsbuilder (appdata). I, for some reason, can't seem to compile my views due to the error in the title of this post.

    My views/web.config is as follows:

            <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.Core.Models.PublishedContent" />
                <add namespace="Umbraco.Web.Mvc" />
                <add namespace="Examine" />
                <add namespace="Umbraco.Web.PublishedModels" />
                <add namespace="Umbraco.Web.PublishedContentModels" />
            <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.Core.Models.PublishedContent" /><add namespace="Umbraco.Web.Mvc" /><add namespace="Examine" /><add namespace="Umbraco.Web.PublishedModels" /></namespaces>
        </pages>
    

    And some detailed compile error is as follows: enter image description here

    enter image description here

    I've tried a multitude of fixes that I have found here on the forum and on stackoverflow but unfortunately nothing seems to work..any ideas?

  • Isaiah Pellarp 19 posts 73 karma points
    Jan 11, 2021 @ 07:33
    Isaiah Pellarp
    0

    bump

  • AddWeb Solution Pvt. Ltd 109 posts 360 karma points
    Jan 11, 2021 @ 14:03
    AddWeb Solution Pvt. Ltd
    0

    Hello Isaiah,

    This could be due to ~/Views/web.config having a reference to the namespace :

    <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>
    

    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.Models Mode setting in your web.config is set to dll or LiveDll, the PublishedContentModels.dll will appear in your bin directory

Please Sign in or register to post replies

Write your reply to:

Draft