There is an upcoming problem that the development team should know about as is it related to new Microsoft Changes.
I created a new Microsoft Aspire Solution from their Visual Studio template. It creates a Blazor project that does not have either an Index.html or a _layout.cshtml file. They load the contents of those files in App.razor.
They also dont use "var builder = WebAssemblyHostBuilder.CreateDefault(args);" , the new Blazor application uses"var builder = WebApplication.CreateBuilder(args);" instead to create the project.
The loading of "_content/IgniteUI.Blazor/app.bundle.js" now only partially works. While some of the UI renders, some of it does not. An Infragistic IgniuteUI List will show a list but onclick will not work. The IgniteUI button will not respond to an onclick event and part of the UI doesnt render.
This is the new App.Razor file...
<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <base href="/" /> <link rel="stylesheet" href="bootstrap/bootstrap.min.css" /> <link rel="stylesheet" href="app.css" /> <link rel="stylesheet" href="AspireOfm.Web.styles.css" /> <link rel="icon" type="image/png" href="favicon.png" /> <link href="_content/IgniteUI.Blazor/themes/light/material.css" rel="stylesheet" /> <link href="_content/IgniteUI.Blazor/themes/grid/light/material.css" rel="stylesheet" /> <link href="css/ig-theme.css" rel="stylesheet" /> <link href="css/app.css" rel="stylesheet" /> <link href="">fonts.googleapis.com/css rel="stylesheet"> <link href="">fonts.googleapis.com/icon rel="stylesheet preload prefetch" as="style"> <HeadOutlet /></head><body> <Routes /> <script src="_content/IgniteUI.Blazor/app.bundle.js"></script> <script src="_framework/blazor.web.js"></script></body></html>
Hello and thank you for contacting Infragistics. Are you using the newer Blazor WebApp template? Which framework are you using?
I am using the built in blazor template when you create a new solution using the Aspire Template (it creates multiple linked projects). It also only works on the preview version of Visual studio 2022 as the aspire technology is in preview. The projects it creates are .Net8.
BlazorHybrid (2).zip
Sounds like you are using the new hybrid app. I attached a working demo, please make sure you use the following style for the IgbGrid.
<link href="_content/IgniteUI.Blazor/themes/grid/light/bootstrap.css" rel="stylesheet" />
or the following for everything else.
<link href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
There is something different about the Aspire project (https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview). I copied the code into the aspire web project but the grid will not appear. I also get this message in the browser
[2024-02-13T11:36:38.613Z] Warning: Initializer 'localhost:5192/.../IgniteUI.Blazor.lib.module.js' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)
Yes, I have seen that recently, I just needed to put the @using reference into the problem file. The file seems to ignore the import file.
Glad to help! Out of curiosity after updating VS 2022 preview to get the Aspire templates I noticed that my regular version of VS 2022 stopped compiling WebApps due to this issue. Have you seen this before?
stackoverflow.com/.../77905883
Thanks for the project, now it works. As you said, it just needed the
<HeadOutlet @rendermode="@InteractiveServer" /> and
<Routes @rendermode="@InteractiveServer" />
added.
There is an issue with global renderingMode Interactions so I added it to App.Razor. That's probably why it wasn't working. This issue is the same in the WebApp template, where you have to select "per page" rendering. These templates are very new so we haven't fully adapted to them yet.
I created my first Aspire Start Application, and very much like the WebApp template the sample works fine. Everything modified was done in AspireApp1.Web only. Let me know if you have any questions.
AspireApp1.zip