Copied to clipboard

Flag this post as spam?

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

  • Rakesh 11 posts 91 karma points
    May 27, 2020 @ 07:35

    Not able to generate ModelBuilder

    Hello All,

    Am new to Umbraco and i was just in the initial stage of getting the content from Umbraco through API call.

    Steps i have followed:

    • Umbraco side content has been added and URL has been hosted on the server
    • Now i need to code on getting the content from Umbraco I have installed necessary package and installed ModelBuilder tool to generate.
    • I have configured Username/Password and hosted URL in the Options/Umbraco tab
    • Now if i try to run the custom tool am getting error "The custom tool 'UmbracoModelsBuilder' failed. One or more errors occured" i tried all the possibility but no luck.
    • Also i observed in the Umbraco side Model Builder version is 8.5.5 but in the Nuget package we have 8.0 as highest.

    NOTE : on the web.config i have added all the necessary key and respective values as mentioned in one of the forum.

    Please help in this. enter image description here Regards,

    Rakesh Balasubramanya

  • Rakesh 11 posts 91 karma points
    Jun 01, 2020 @ 09:50

    Please let me know if i can get any help on this... Currently my work has been stopped calling the API (Getting the content from Umbraco into our Application).

  • Jules 273 posts 584 karma points
    Jun 02, 2020 @ 11:10

    You don't necessarily need to install modelsbuilder in v8. A light version is part of the core. Might be worth uninstalling the additional package and checking whether the core install is sufficient for your needs before adding anything extra.

    You do also need to choose which modelsbuilder mode you want to work with. By default it is PureLive (this is what you seem to have currently) which is not suitable if you want to use your models throughout your code (not just views). I always use AppData which by default will dump your generated models in App_Data/Models. You do not have to put models here but you will need additional config to have them generated elsewhere.

    You will need to add/edit the following config items in web.config/appsettings

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

    NB: Using AppData, you will need to include the generated models in your visual studio project.

    If you get any further errors, be sure to check what those errors are in App_Data/Logs. A common issue is Umbraco needs write access in order to be able to generate models so check that this is not an issue.

    Hopefully that should point you in the right direction but you should also refer to documentation here

    If you find any errors in the logs please let us know what they are in full.

    By the way, with the above configuration, you will have a button on the ModelsBuilder dashboard, in the back-office, that will allow you to generate models.

    Good luck


Please Sign in or register to post replies

Write your reply to: