Copied to clipboard

Flag this post as spam?

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


  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Mar 17, 2017 @ 10:23
    Frans de Jong
    0

    Working with modelsbuilder and extensions project

    Hi all,

    We are using umbraco with a extensions project so we have a solutionfile with 2 projects.

    I now copy the models from the App_Data/Models folder to the models/generated folder in the extensions project. This method is prone to errors and its manual stuf I can do without.

    What is the best way to work with the extensions project? I cant find any documentation about this.

    Thanks Frans

  • Damiaan 442 posts 1302 karma points MVP 6x c-trib
    Mar 17, 2017 @ 10:27
    Damiaan
    1

    You could write your models outside of your website into another project. See AcceptUnsafeModelsDirectory in the documentation.

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Mar 17, 2017 @ 10:33
    Michaël Vanbrabandt
    1

    Hi Frans,

    what we do is set the ModelsBuilder to Dll and then reference our second project to this dll which is called Umbraco.Web.PublishedContentModels and is located in the bin folder of your main project.

    Hope this helps!

    /Michaël

  • Micha Somers 134 posts 597 karma points
    Mar 17, 2017 @ 13:14
    Micha Somers
    100

    Several configurations are possible, and some may fit better for your purposes than others.

    Which one fits best, is hard to tell.

    I have tried several configurations. So far, the solution that works quite flexible for me is one that uses the Umbraco.ModelsBuilder.Api, having ModelsMode set to Nothing, and where the models are generated directly into my class library (via Run custom tool).

    This way I can decide for myself when in the development process, I want to generate new/updated classes and in which class libraries.

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Mar 17, 2017 @ 13:38
    Frans de Jong
    0

    Thanks for the answers all!!

    @Micha: Are you using this custom tools as a base?

    https://github.com/zpqrtbnk/Zbu.ModelsBuilder/tree/master/Umbraco.ModelsBuilder.CustomTool

  • Micha Somers 134 posts 597 karma points
    Mar 17, 2017 @ 13:55
    Micha Somers
    1

    Yes, that's the CustomTool extension I am using.

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Mar 17, 2017 @ 14:02
    Frans de Jong
    0

    Thanks! This sounds like a solution that fits our case

Please Sign in or register to post replies

Write your reply to:

Draft