Copied to clipboard

Flag this post as spam?

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


  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jul 24, 2019 @ 08:42
    Chriztian Steinmeier
    0

    Models Builder woes...

    Hi there Models Builders,

    I've been using the default PureLive mode for years now, but recently I'm constantly running into problems where I get a YSOD that tells me the model doesn't exist.

    I double check names, casing etc. and even check the models.generated.all.cs file to verify that the model is in fact there... so I do the only thing left and restart the site, and find that everything works!! ??

    It's such a huge pain when stuff isn't "in sync". In the old days I could always rely on the XML in the umbraco.config file; the only time I started seeing stuff out of sync there was when I started using Razor...

    I work with Umbraco Cloud from a Mac, so I don't have Visual Studio - but I'd really like to know if there's another mode I can use where I can be sure that the models I see either in the files in the Models directory, or the names I see in the Backoffice are actually there for use in my partials/views etc. ?

    (This is currently hitting me hard on Umbraco Cloud in Umbraco 7.14.0)

    Thanks, /Chriztian

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jul 24, 2019 @ 08:49
    Dave Woestenborghs
    101

    HI Chriztian,

    I always keep clear from the live modes of modelsbuilder. To much magic going on in the background at runtime.

    I think it's better to use the Dll mode. The only downside is that you need to go in to the backoffice and click the generate models button each time you change your doctypes.

    Make sure you log the issue at https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues

    Dave

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jul 24, 2019 @ 08:54
    Chriztian Steinmeier
    0

    Thanks Dave!

    I don't think I'll mind clicking a Generate button, since I always know when I've changed stuff. And if it means things work more reliably it'll be a huge win.

    /Chriztian

  • Matthew Wise 271 posts 1373 karma points MVP 5x c-trib
    Jul 24, 2019 @ 10:05
    Matthew Wise
    3

    You can also click the arrow when saving a doc type and do save and generate models.

    I agree with Dave, on a Mac Dll is your best best

    Matt

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jul 24, 2019 @ 10:22
    Chriztian Steinmeier
    0

    You can also click the arrow when saving a doc type and do save and generate models.

    Yeah that was something I wondered, as the docs mentioned something about also being able to do it in the Doctype Editor.

    Cool. Thanks!

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Aug 09, 2019 @ 14:05
    Chriztian Steinmeier
    0

    Oh my...

    Tried the Dll mode which seems to work as expected. I edit the models and when I've made all the changes I need, I generate the models. Works fine.

    But... now I've run into some weirdness where a view says a model hasn't got a property. OK, I generate models and everything works great.

    An hour later, I push another chunk of code to DEV and now that same view is complaining again, about that same property?

    I check the Models in Kudu and see that the specific model does in fact have that property. So now I'm in "something hasn't synced" land again, and it's SUPER frustrating to work with, when it's all something that I shouldn't be worrying about in the first place.

    I know the App_Data directory with the models doesn't travel with the git push/pull and the actual built DLL doesn't go anywhere neither, so I can't figure out where the actual problem is.

Please Sign in or register to post replies

Write your reply to:

Draft