Copied to clipboard

Flag this post as spam?

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


  • Sören Deger 733 posts 2844 karma points c-trib
    Feb 27, 2019 @ 09:43
    Sören Deger
    0

    Modelsbuilder API Exception in V8

    Good morning Unicorns :-)

    I have problems to run the custom tool "UmbracoModelsBuilder" in V8. I have install Umbraco V8 and Umbraco.ModelsBuilder.Api v8.0.1 per nuget.

    I have already installed the extension "Umbraco ModelsBuilder Custom Tool" with v3.0.6.97 in VS 2017.

    In my web.config I have this entries:

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

    In VS options > UmbracoModelsBuilder: I entered the localhost, user and password for this umbraco instance.

    My VS project looks like this:

    enter image description here

    I have set the value for "Benutzerdefiniertes Tools" = Custom Tool to UmbracoModelsBuilder.

    Then I run the VS project, created a few document types and then I click in VS on Builder.cs and run "Custom Tool".

    But now, I get this error message:

    Error with the custom tool "UmbracoModelsBuilder". At least one error has occurred.
    

    Anyone has an idea was it going wrong and how I can solve this issue?

    Best regards,

    Sören

  • Matthew Wise 271 posts 1373 karma points MVP 4x c-trib
    Feb 27, 2019 @ 09:55
    Matthew Wise
    101

    Hi Sören

    I believe the API plugin has not been updated to support v8 as yet.

    I can suggest an alternative whilst it is been updated that will allow you to swap back:

     <add key="Umbraco.ModelsBuilder.ModelsMode" value="LiveAppData" />
        <add key="Umbraco.ModelsBuilder.AcceptUnsafeModelsDirectory" value="true" />
        <add key="Umbraco.ModelsBuilder.ModelsDirectory" value="Folder" />  
    

    You will need to manually include the generated.cs files though

    I also suggest setting ModelsMode to "Nothing" on anything other than local so it doesnt generate .cs files on your server.

    Matt

  • Gilles 26 posts 108 karma points
    Feb 27, 2019 @ 12:11
    Gilles
    0

    I have the same problem as the original poster (Sören Deger). However, I do believe that the API NuGet package has been updated.

    Indeed, if you visit NuGet you will see that only a few days ago, a new version has been uploaded, bringing the version from 3.0.10 to 8.0.1 (which makes me believe that is should work with v8).

    In contrast, what hasn't changed, is the UmbracoModelsBuilder Extension for Visual Studio (Custom Tool). This is still at version 3.0.6.97 which is actually from 2017 according to the Marketplace. Probably the bug lies with the extension.

    Your solution is the one I'm going with for the moment.

  • Sören Deger 733 posts 2844 karma points c-trib
    Feb 27, 2019 @ 10:18
    Sören Deger
    2

    Hi Matthew,

    thank you for the very fast answer :-) This works for me.

    And for other devs in the community with similar requirements: I actually needed the API models to have a custom namespace in the models. With the solution from Matthew and this additional key, I can simply change the default namespace of the models:

    <add key="Umbraco.ModelsBuilder.ModelsNamespace" value="My.Custom.Namespace.Models"/>
    
  • Chris Kim 48 posts 253 karma points c-trib
    Mar 04, 2019 @ 00:58
    Chris Kim
    0

    While the Visual Studio extension hasn't been updated yet, the good news is that the developer is active and has replied to the comments on the Marketplace listing and states that he will update it ASAP to add U8 and VS2019 support:

    https://marketplace.visualstudio.com/items?itemName=ZpqrtBnk.UmbracoModelsBuilderCustomTool#qna

    We are hoping the extension will be updated soon, we probably won't make any commitment to U8 until that is working, as it is part of our workflow.

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 06, 2019 @ 15:23
    Sören Deger
    0

    Short update:

    the updated Custom Tool comes with Umbraco v8.0.1 on tuesday:

    https://our.umbraco.com/download/releases/801

    Best, Sören

Please Sign in or register to post replies

Write your reply to:

Draft