Copied to clipboard

Flag this post as spam?

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

  • Ondřej Kobza 15 posts 96 karma points
    Jan 26, 2020 @ 20:28
    Ondřej Kobza

    Models Builder error after generating models

    Hi guys. Umbraco v8.4, Models Builder 8.1

    I get this error everytime I change some properties, generate models and rebuild the project:

    Error   CS1061  'IHtmlString' does not contain a definition for 'GetContentGrid' and no accessible extension method 'GetContentGrid' accepting a first argument of type 'IHtmlString' could be found (are you missing a using directive or an assembly reference?) SimpleArticle.generated.cs

    To fix it, I always have to:

    1. Change Models Builder from AppData to PureLive
    2. Exclude the models folder from the project
    3. Rebuild
    4. Start the project
    5. Change back from PureLive to AppData
    6. Generate the models again in Umbraco backoffice
    7. Include the models folder again
    8. Rebuild the project one more time.

    ...and the error is gone. Until the next time I wanna generate models.

    Any idea what might be causing it or where I should look?

  • daniel 7 posts 37 karma points
    Mar 13, 2020 @ 20:31

    Hi, did you fix it

  • Jamie Attwood 174 posts 427 karma points c-trib
    Aug 30, 2021 @ 15:20
    Jamie Attwood

    Hey there, just ran into a similar issue.

    If you are using Models Builder as a separate class library (or perhaps in your main Umbraco set up) and you are using VS2019, there could be an issue with how you set up your initial project. For example, for some reason there are many ways to create class libraries/projects. Make sure that you didn't accidentally select VB instead of c#. Also, installed as a separate class library, you need to choose "Class Library (.NET Framework)" in order to target 4.7.2 .net framework.

Please Sign in or register to post replies

Write your reply to: