XDboy
XDboy

Reputation: 169

Blazor unhandled exception: Cannot provide a value for property 'BlazorStrapSrc' on type 'BlazorStrap.BSCarousel'

I am using VS 2022 and created a Blazor WebAssembly ASP.NET Core hosted project. I want to implement an image slider on my Index.razor and tried to use BlazorStrap. This is the code I am using:

@using BlazorStrap
<BSCarousel HasControls="true" HasIndicators="true" >
    <BSCarouselItem>
        <svg class="bd-placeholder-img bd-placeholder-img-lg d-block w-100" width="800" height="400" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: First slide" preserveAspectRatio="xMidYMid slice" focusable="false">
            <rect width="100%" height="100%" fill="#777"></rect><text x="50%" y="50%" fill="#555" dy=".3em">First slide</text>
        svg>
    </BSCarouselItem>
    <BSCarouselItem>
        <svg class="bd-placeholder-img bd-placeholder-img-lg d-block w-100" width="800" height="400" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Second slide" preserveAspectRatio="xMidYMid slice" focusable="false">
            <rect width="100%" height="100%" fill="#666"></rect><text x="50%" y="50%" fill="#444" dy=".3em">Second slide</text>
        </svg>
    </BSCarouselItem>
    <BSCarouselItem>
        <svg class="bd-placeholder-img bd-placeholder-img-lg d-block w-100" width="800" height="400" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Third slide" preserveAspectRatio="xMidYMid slice" focusable="false">
            <rect width="100%" height="100%" fill="#555"></rect><text x="50%" y="50%" fill="#333" dy=".3em">Third slide</text>
        </svg>
    </BSCarouselItem>
</BSCarousel>

But if I start to debug it I get this error:

enter image description here

enter image description here

What do I need to do? What did I forgot?

Upvotes: 0

Views: 2345

Answers (1)

Mister Magoo
Mister Magoo

Reputation: 8964

You may not have registered BlazorStrap in services?

builder.Services.AddBlazorStrap();

Upvotes: 1

Related Questions