Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit '7CAjo0IMmJfXK6NRHWVcsHP2ZrRlvtRMTCgTwRpRFfc'.
System.AggregateException: One or more errors occurred. (Error: No element is currently associated with component 2)
---> System.InvalidOperationException: Error: No element is currently associated with component 2
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32 updatedComponents)
Any details on how to reproduce this exception?
That's pretty Easy to do. Just create any Blazor server app as a new application from the templates. The error happens the first time you run the application. Also for some peculiar reason, the Components.App is not found either.
Did you install a new version of the .NET framework or Visual Studio 2022 preview? We can't reproduce such an error (and it would mean our product doesn't work completely).
What is the output of running dotnet --info
in command prompt?
I have installed the latest Visual Studio 2022 Preview (17.3.1 - Preview 2.1) IDE. Is that a Problem? Also, here is the listing for dotnet --info: .NET SDK:
Version: 9.0.200-preview.0.24575.35
Commit: 81b5f040be
Workload version: 9.0.200-manifests.054dcb45
MSBuild version: 17.13.0-preview-24569-04+8f6b8ad0a
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\
.NET workloads installed:
[maccatalyst]
Installation Source: VS 17.13.35617.110
Manifest Version: 18.1.9163/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.1.9163\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: VS 17.13.35617.110
Manifest Version: 18.1.9163/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.1.9163\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: VS 17.13.35617.110
Manifest Version: 9.0.0/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
Install Type: Msi
[android]
Installation Source: VS 17.13.35617.110
Manifest Version: 35.0.24/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.24\WorkloadManifest.json
Install Type: Msi
[aspire]
Installation Source: VS 17.13.35617.110
Manifest Version: 8.2.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
Install Type: Msi
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4
.NET SDKs installed:
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.101 [C:\Program Files\dotnet\sdk]
9.0.200-preview.0.24575.35 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
dotnet command - .NET CLI | Microsoft Learn
Download .NET:
https://aka.ms/dotnet/download
Yes. Radzen Blazor Studio doesn't support preview versions of the .NET SDK (which was probably installed via the VS 2022 Preview). A possible workaround is mentioned in this thread: (create a global.json file in the project directory). We haven't tested it though. The other option is to uninstall the VS 2022 preview and use the official version.
I have uninstalled the Visual Studio 2022 Preview (17.3.1—Preview 2.1) and reinstalled the (Official) Visual Studio 17.12.3. There are no errors in the output. However, when I run the application from the IDE, it doesn't auto-start the browser and load the Blazor application, which is odd. I am still researching that weirdness.
I finally just uninstalled Radzen Balzor Studio and Reinstalled it. I created a BASIC Web Test Application and these are the errors that I received: dotnet watch Hot reload enabled. For a list of supported edits, see Supported Code Changes (C# and Visual Basic) - Visual Studio (Windows) | Microsoft Learn.
Press "Ctrl + R" to restart.
Using launch settings from D:\My Projects\FlexOps\Asp.NET\Blazor\BlazorWebAppTest\Properties\launchSettings.json...
Building...
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: D:\My Projects\FlexOps\Asp.NET\Blazor\BlazorWebAppTest
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: TypeError: Cannot read properties of null (reading 'insertBefore')
System.InvalidOperationException: TypeError: Cannot read properties of null (reading 'insertBefore')
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32 updatedComponents)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'Sglr_gh9-kIuietYD1TE4w5ZEZp1nyHm8gvpI86PuxI'.
System.AggregateException: One or more errors occurred. (TypeError: Cannot read properties of null (reading 'insertBefore'))
---> System.InvalidOperationException: TypeError: Cannot read properties of null (reading 'insertBefore')
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32 updatedComponents)
--- End of inner exception stack trace ---
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Error: No element is currently associated with component 2
System.InvalidOperationException: Error: No element is currently associated with component 2
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32 updatedComponents)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'Sglr_gh9-kIuietYD1TE4w5ZEZp1nyHm8gvpI86PuxI'.
System.AggregateException: One or more errors occurred. (Error: No element is currently associated with component 2)
---> System.InvalidOperationException: Error: No element is currently associated with component 2
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32 updatedComponents)
--- End of inner exception stack trace ---
The application started, but on initial refresh, the screen did not paint completely. I do not get these errors in Visual Studio 2022. Any Ideas?
I am using Windows 11 24H2 and MS Edge, and Visual Studio 17.12.3
Do you still have a preview version of .NET installed? We haven't seen those errors before so we can't comment further.
No I do not. .NET SDK:
Version: 9.0.101
Commit: eedb237549
Workload version: 9.0.100-manifests.4a280210
MSBuild version: 17.12.12+1cce77968
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.101\
.NET workloads installed:
[android]
Installation Source: SDK 9.0.100, VS 17.12.35527.113
Manifest Version: 35.0.7/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.7\WorkloadManifest.json
Install Type: Msi
[aspire]
Installation Source: SDK 9.0.100, VS 17.12.35527.113
Manifest Version: 8.2.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: SDK 9.0.100, VS 17.12.35527.113
Manifest Version: 18.1.9163/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.1.9163\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: SDK 9.0.100, VS 17.12.35527.113
Manifest Version: 18.1.9163/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.1.9163\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: SDK 9.0.100, VS 17.12.35527.113
Manifest Version: 9.0.0/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
Install Type: Msi
[wasm-tools-net8]
Installation Source: VS 17.12.35527.113
Manifest Version: 9.0.0/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.net8\9.0.0\WorkloadManifest.json
Install Type: Msi
[wasm-tools]
Installation Source: VS 17.12.35527.113
Manifest Version: 9.0.0/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.current\9.0.0\WorkloadManifest.json
Install Type: Msi
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4
.NET SDKs installed:
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
dotnet command - .NET CLI | Microsoft Learn
Download .NET:
.NET Downloads (Linux, macOS, and Windows)
Yes, this looks fine. What kind of application did you create in Radzen Blazor Studio? And what happens when you open it in the browser? Can you attach a screenshot?
Thanks! Could you try opening the app in a different browser or incognito (private) mode? Some browser plugin could be interfering. You can also try with different rendering modes to see if this makes a difference (server, auto, web assembly).
I am re-creating a Ship Manager server application that will reside on Azure and our ASP.Net Core 9 Web API. I usually use "uBlock Origin," "Ghostery," "Malwarebytes BrowserGuard," and "I Don't Care About Cookies". I disabled/removed all but uBlock Origin and Ghostery, and the test app runs. However, my application does not launch via the Radzen Blazor Studio IDE in the browser. I can, however, run it directly in the browser by typing in the URL.
Check
Check the launchSettings.json file of your app. It should contain the following lines:
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
And it does.Here's my laundSettings.json file: {
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:19712",
"sslPort": 44395
}
},
"profiles": {
"VisionSuiteShipManagerServer.Server": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
It seems fine. To be honest I am out of ideas why the browser isn't opening for this app. Radzen Blazor Studio doesn't manually open the browser when you click the Run button. It just runs dotnet watch run
for your the application and it builds the app and opens a browser. More info is available here: How to suppress dotnet whatch run to open a browser
Does it open when you create a new app? How about when you run it from Visual Studio? You can also check via source control when was the last time the browser was launching.
You can send us your solution to info@radzen.com and we will check if it running opens a browser. Upload it to some cloud storage service and share a download link with us.
Here you go. It runs in the Visual Studio 2022 v17.13.2 but not in the Radzen Blazor Studio v1.36.2 IDE. LINK REDACTED.
Something in your Program.cs prevents the app from starting with dotnet watch run
. I have commented out most of the custom code and it started launching the browser as expected. I am not 100% sure what does that but I suspect it is the code which redirects the logging. I believe dotnet watch run
expects a status message in the console to open the browser. (Now listening on: https://localhost:5001
). Your app doesn't produce such output in the console.
Here is the updated code:
using Brickmakers.AspSecurityHeaders;
using Microsoft.EntityFrameworkCore;
using Radzen;
using Serilog;
using System.IdentityModel.Tokens.Jwt;
using VisionSuiteShipManagerServer.Components;
using VisionSuiteShipManagerServer.Exceptions;
using VisionSuiteShipManagerServer.Extensions;
using VisionSuiteShipManagerServer.Services;
using Environment = System.Environment;
using LoggingBuilderExtensions = VisionSuiteShipManagerServer.Extensions.LoggingBuilderExtensions;
var builder = WebApplication.CreateBuilder(args);
/*
builder.Configuration.AddJsonFile("appsettings.json", false, true);
builder.Configuration.AddJsonFile("appsettings.development.json", false, true);
Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
builder.Logging.ClearProviders();
await LoggingBuilderExtensions.AddSerilogLoggingAsync(builder.Configuration, cfg =>
{
cfg.WriteTo.Console();
}).ConfigureAwait(false);
Log.Debug("Adding Serilog Structured Logging");
builder.Host.UseSerilog();
// Add services to the container.
Log.Debug("Adding services to the container");
Log.Information(" => Configuring Razor Components and Controllers");
*/
builder.Services.AddRazorComponents().AddInteractiveServerComponents().AddHubOptions(options => options.MaximumReceiveMessageSize = 10 * 1024 * 1024);
builder.Services.AddControllers();
Log.Information(" => Adding Radzen Components");
builder.Services.AddRadzenComponents();
builder.Services.AddRadzenCookieThemeService(options =>
{
options.Name = "VisionSuiteShipManagerServerTheme";
options.Duration = TimeSpan.FromDays(365);
});
builder.Services.AddHttpClient();
builder.Services.AddScoped<VisionSuiteShipManagerServer.GhostdbService>();
builder.Services.AddDbContext<VisionSuiteShipManagerServer.Data.GhostdbContext>(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("GhostdbConnection"));
});
/*
Log.Debug(" => Adding and Configuring Output Cache");
builder.Services.AddOutputCache(o =>
{
o.DefaultExpirationTimeSpan =
TimeSpan.FromMinutes(builder.Configuration.GetValue<int>("CacheSettings:DefaultExpirationMinutes"));
o.MaximumBodySize = builder.Configuration.GetValue<long>("CacheSettings:MaximumBodySize");
o.SizeLimit = builder.Configuration.GetValue<int>("CacheSettings:SizeLimit");
o.UseCaseSensitivePaths = builder.Configuration.GetValue<bool>("CacheSettings:UseCaseSensitivePaths");
o.AddBasePolicy(x => x.Cache());
});
Log.Debug(" => Creating Cross-Origin Resource Sharing");
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
builder.Services.AddConfiguredCors(builder.Configuration, builder.Environment);
*/
/*
Log.Debug(" => Adding FlexOps, Custom Services");
*/
builder.Services.AddScoped<ApplicationPropertiesService>();
builder.Services.AddScoped<GlobalDataService>();
Log.Debug(" => Adding Global Exception Handler with Customized Problem Details");
builder.Services.ConfigureCustomProblemDetails();
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();
Log.Debug(" => Adding HSTS and Redirect Options");
builder.Services.AddConfigureHstsAndHttpsRedirection(builder.Environment.IsDevelopment());
Log.Debug(" => Adding Anti-Forgery Token with Options");
builder.Services.AddAntiforgery(options =>
{
options.HeaderName = "X-CSRF-TOKEN"; // Optional: For APIs or custom header handling
});
Log.Debug("Building the API");
var app = builder.Build();
// Configure the HTTP request pipeline.
Log.Debug("Configuring the HTTP request pipeline");
Log.Debug(" => Adding Strict Security Headers to all Responses");
/*
app.UseBmApiSecurityHeaders(); // Add Strict Security Headers to all Responses
app.UseCors("default"); // Apply CORS with Named Policy .
// Add Our Custom Output Caching Middleware
Log.Information(" => Adding Output Cache Custom Middleware");
app.UseOutputCache();
*/
app.UseAntiforgery();
if (!app.Environment.IsDevelopment())
app.UseHsts();
else
app.UseDeveloperExceptionPage();
/*
app.UseExceptionHandler();
app.UseStatusCodePages();
*/
app.UseHttpsRedirection();
app.MapControllers();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>().AddInteractiveServerRenderMode();
Log.Information(" => Running the Application");
GlobalDataService.ApplicationStartDate = DateTime.Now;
app.Run();