Search code examples
asp.net-corenuget-packageblazor-client-side

Blazor wasm new project not recognizing Radzen Nuget Pkg


If I create a new Blazor wasm (client-side) project with Radzen, I'm not able to compile.

  1. Create a new Blazor wasm project
  2. Add a nuget pkg (Radzen.Blazor)
  3. Add this line to the index.html file
  4. Add a @using Radzen.Blazor to the _Imports.razor file

I get a red squiggly under the "@using Radzen.Blazor" statement and a compile time error saying that the namespace Radzen couldn't be found. From the sparse doco I've found on Radzen wasm, I thought that these were the only steps.

Environment:

VS 2019
asp.net core 3.1-preview 2.19528
Radzen.Blazor 2.5.7 
.net standard lib 2.0.3

index.html

<body>
    <app>Loading...</app>

    <div id="blazor-error-ui">
        An unhandled error has occurred.
        <a href class="reload">Reload</a>
        <a class="dismiss">🗙</a>
    </div>
    <script src="_framework/blazor.webassembly.js"></script>
    <script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
</body>

_Imports.razor

@using System.Net.Http
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.JSInterop
@using BlazorApp1
@using BlazorApp1.Shared
@using Radzen.Blazor // <--- red squiggly here: "'Radzen' could not be found"

Solution

  • Got it! I had to upgrade to wasm 3.2. That did the trick.

    Here's the answer: https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-2-release-now-available/