Copied to clipboard

Flag this post as spam?

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


  • Peter Aderhold 30 posts 204 karma points
    Nov 01, 2019 @ 12:26
    Peter Aderhold
    0

    Installing on server: The type or namespace ... does not exist in the namespace 'Umbraco.Web.PublishedModels'

    Hi folks,

    after developing a basic site locally (in VS 2019, Umbraco via NuGet) I'm trying to install Umbraco on a server. Locally everything works fine.

    On the server I'm facing several problems.

    Trying to show the site itself I'm getting the error:

    The type or namespace name 'Homepage' does not exist in the namespace 'Umbraco.Web.PublishedModels'

    Backoffice works at first glance, but on certain pages I get:

    Request error: The URL returned a 404 (not found): /[MySite]/umbraco/backoffice/UmbracoApi/ContentType/GetPropertyTypeScaffold

    and

    No list view data type was found for this document type, ensure that the default list view data types exists and/or that your custom list view data type exists

    followed by a long stack trace.

    What I did:

    Following this and this thread

    I changed

    <add namespace="Umbraco.Web.PublishedModels" />
    

    to this line

    <add namespace="Umbraco.Web.PublishedContentModels" />
    

    in the web.config.

    Now I get

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

    So, it doesn't work this way.

    ModelsBuilder is installed.

    <add key="Umbraco.ModelsBuilder.Enable" value="true" />
    <add key="Umbraco.ModelsBuilder.ModelsMode" value="PureLive" />
    

    Database connection works.

    Any ideas how to solve this seemingly very basic problem?

    Thanks in advance!

    Peter

  • bronzewind 42 posts 125 karma points
    Nov 01, 2019 @ 13:20
    bronzewind
    1

    Hi Peter,

    Are those files with the generated models part of your solution? If they are not part of your solution they won't get deployed. Find those first and add them to your solution. If you haven't changed anything you should find them by searching this file: models.generated.cs in your solution folder. Take all the files in the same folder where that one is, you will need them all, include them in your package to be deployed.

    Let me know if you have further issues.

  • Peter Aderhold 30 posts 204 karma points
    Nov 01, 2019 @ 13:30
    Peter Aderhold
    0

    Thanks, bronzewind, for your help.

    Good idea. I did it.

    But now: it's not possible to build the project since we have a lot of "already declared" errors.

    This is the result.

  • Peter Aderhold 30 posts 204 karma points
    Nov 01, 2019 @ 13:40
    Peter Aderhold
    0

    I excluded all other files from the App_Data folder. Almost all dublicate-errors are gone.

    Except: //[assembly:System.Reflection.AssemblyVersion("0.0.0.6")]

    I commented this line out.

    Now I get the following error when starting the site:

    Compiler Error Message: CS0433: The type 'Homepage' exists in both 'App_Web_all.generated.cs.8f9494c4.chdfy6q3, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' and 'CostaVerde, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

    ...

    Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\90fe5919\ca1ff65\App_Web_homepage.cshtml.65a2d1ee.9bwocvkm.0.cs Line: 42

  • Peter Aderhold 30 posts 204 karma points
    Nov 02, 2019 @ 17:13
    Peter Aderhold
    100

    I got the solution.

    1.) The Database was not correctly installed. I had a lower SQL Server Version on my server as locally. So I followed this way:

    https://stackoverflow.com/a/30593611

    and it works.

    2.) As described here:

    https://our.umbraco.com/forum/using-umbraco-and-getting-started/87333-in-general-what-files-folders-can-be-excluded-when-publishing-umbraco#comment-276920

    I excluded the whole App_Data folder (as I did at first) from my project. Otherwise it's not possible to build the solution.

Please Sign in or register to post replies

Write your reply to:

Draft