Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 939 posts 2574 karma points
    May 22, 2023 @ 13:00
    Claushingebjerg
    0

    Umbraco.Community.BlockPreview build error

    Im trying to install Rick Butterfield's Umbraco.Community.BlockPreview 1.2.1 on 10.5.1

    Install goes fine, but when i add add AddBlockPreview() to the Startup.cs file, before AddWebsite(), as stated in the docs, i get the follwing error on build.

    error CS1061: 'IUmbracoBuilder' does not contain a definition for 'AddBlockPreview' and no accessible extension method 'AddBlockPreview' accepting a first argument of type 'IUmbracoBuilder' could be found (are you missing a using directive or an assembly reference?)
    

    Any Clues?

  • Frans de Jong 550 posts 1862 karma points MVP 4x c-trib
    May 22, 2023 @ 14:01
    Frans de Jong
    0

    It seems like you are missing a using in your startup file. What happens if you add using Umbraco.Community.BlockPreview.BlockPreviewUmbracoBuilderExtensions

    to the startup?

  • Claushingebjerg 939 posts 2574 karma points
    May 23, 2023 @ 06:49
    Claushingebjerg
    100

    You should add this to the satrt of your startup.cs just after namespace

    namespace BlockProject
    {
        using Umbraco.Community.BlockPreview;
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies