Open Closed

DevExpress Blazor integration build error CS0146 #2154


User avatar
0
david.bandinelli.unoinformatica created
  • ABP Framework version: v4.4.3
  • UI type: Blazor WebAssembly
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

We are trying to integrate the DevExpress Blazor components to our Blazor WebAssembly frontend. We have installed the DevExpress Blazor components and added a reference to the DevExpress.Blazor 21.2.3 nuget package to the Blazor project. We have added the following using to the _Imports.razor file: @using DevExpress.Blazor We have added the following line to the Program.cs of the Blazor project:

builder.Services.AddDevExpressBlazor(); after the instruction:

var builder = WebAssemblyHostBuilder.CreateDefault(args);

That's all we did. When we try to build the Blazor project we get the following compile errors: Error CS0146 Circular base type dependency involving 'DevExpress' and 'DevExpress' Error CS0426 The type name 'Blazor' does not exist in the type 'DevExpress'

Can you please help us ?


2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can check: https://community.abp.io/articles/using-devexpress-blazor-ui-components-with-the-abp-framework-wrpoa8rw

  • User Avatar
    0
    improwise created

    Haven't tried this in WASM but at least for server side Blazor, those instructions are not valid any more, as the DevExpress.Blazor package now seems to add a Startup.DevExpress.cs file containing this so probably not needed to add it manually. Also don't forgett about the @using DevExpress.Blazor which can be easy to miss but seems you have already done that.

    //------------------------------------------------------------------------------ //<auto-generated> // Generated by the DevExpress.Blazor package. // To prevent this operation, add the DxExtendStartupHost property to the project and set this property to False. // // MIBS.Blazor.csproj: // // <Project Sdk="Microsoft.NET.Sdk.Web"> // <PropertyGroup> // <TargetFramework>net5.0</TargetFramework> // <DxExtendStartupHost>False</DxExtendStartupHost> // </PropertyGroup> //</auto-generated> //------------------------------------------------------------------------------ using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Hosting;

    [assembly: HostingStartup(typeof(MIBS.Blazor.DevExpressHostingStartup))]

    namespace MIBS.Blazor { public partial class DevExpressHostingStartup : IHostingStartup { void IHostingStartup.Configure(IWebHostBuilder builder) { builder.ConfigureServices((serviceCollection) => { serviceCollection.AddDevExpressBlazor(); }); } } }

    Please get back with if this works or if you have found some other solution as we are also considering using DevExpress Blazor in a new project instead of Blazorise.

    Edit:

    Seems like things might be a bit different in the WASM world and that the startup.devexpress.cs isn't created by the package installer there.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11