ComponentBase

Every component starts with following code:

    public partial class ClassName
    {

and if I try to use let say ClassName.OnInitializedAsync() I receive an error like this:

ClassName.razor.cs(44,39): error CS0115: 'ClassName.OnInitializedAsync()': no suitable method found to override

and I found that very small detail solve the problem, that is this line bellow

    public partial class ClassName : ComponentBase
    {

Why does this declaration not default during component generation and if it is not important how to solve this problem?

You should not have to specify the base class and should be able to override OnInitializedAsync without errors. Here is how it looks normally.

Is there anything special about that page? Also are you using the latest version of Radzen Blazor for Visual Studio (v1.42.8)? There was a known compatibility issue with .NET 10.0.400 which latest versions address. That issue could lead to "no suitable method found to override" errors.

This issue is not from today. I have been struggling with that for more than two years but as the solution was a relatively easy but annoying task I did not make any complaints. I had this problem long before RB4VS existed. But today I asked for a solution.

Does the issue happen in a brand new application created with either RB4VS or RBS? Or does it happen in existing applications only? You can try adding a method in Index.razor.cs available in the default Empty application template.

This particular application is on .NET 9 and it is not only an application with the same issue. But I have to admit that the new application is based on .NET 10 has no issue at all.

You can specify .NET 9 as a target framework when creating a new application. Does the problem appear then?

Ok. I made a brand new application with MSSQL db scaffolding and let RBS make some CRUD tables just to have an example. Application is made in one step. No afterwards editing.

First that I noticed is from RB4VS, although the application is running with no issue after compiling in VS when I want to edit any screen Design time build failed.

E:\projekti\TestBuild\Components\Pages\Konto.razor.cs(63,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditKonto' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditKonto' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Partneri.razor.cs(63,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditPartneri' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditPartneri' to 'Microsoft.AspNetCore.Components.IComponent'.

Second, when I touch this method, just make extra line after curly bracket

        protected override async Task OnInitializedAsync()
        {

            kontoCollection = await ErpBoxService.GetKonto(new Query { Filter = $@"i => i.KonId.Contains(@0) || i.Naziv.Contains(@0) || i.Aop.Contains(@0) || i.K_D_O.Contains(@0)", FilterParameters = new object[] { search }, Expand = "Valuta" });
        }

I receive following errors

:\projekti\TestBuild\Components\Pages\AddPartneri.razor.cs(35,39): error CS0115: 'AddPartneri.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\AddKursevi.razor.cs(35,39): error CS0115: 'AddKursevi.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\EditKonto.razor.cs(38,39): error CS0115: 'EditKonto.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\EditKursevi.razor.cs(38,39): error CS0115: 'EditKursevi.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\EditPartneri.razor.cs(38,39): error CS0115: 'EditPartneri.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\AddKonto.razor.cs(35,39): error CS0115: 'AddKonto.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\Kursevi.razor.cs(50,39): error CS0115: 'Kursevi.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\Konto.razor.cs(50,39): error CS0115: 'Konto.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\Partneri.razor.cs(50,39): error CS0115: 'Partneri.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\Partneri.razor.cs(57,33): error CS0311: The type 'NewAppNET9.Components.Pages.AddPartneri' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.AddPartneri' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Kursevi.razor.cs(57,33): error CS0311: The type 'NewAppNET9.Components.Pages.AddKursevi' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.AddKursevi' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Konto.razor.cs(58,33): error CS0311: The type 'NewAppNET9.Components.Pages.AddKonto' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.AddKonto' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Partneri.razor.cs(63,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditPartneri' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditPartneri' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Konto.razor.cs(64,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditKonto' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditKonto' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Kursevi.razor.cs(63,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditKursevi' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditKursevi' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Program.cs(43,24): error CS0246: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)

So, yes I can confirm this error in a brand new application.

Just to confirm - is the issue reproducible in both RBS and RB4VS or just RB4VS? Also does the analysis detect any issues?

Please send us the project you have generated (TestBuild) to info@radzen.com.

OnInitializedAsync() is defined by ComponentBase, so the error occurs because the generated partial class does not currently inherit from it. If the .razor file is a normal Blazor component, the generated class usually gets that inheritance from the component itself. Adding : ComponentBase in the code-behind works, but it may be worth checking the generated .razor file and Radzen component generation settings first. The key is making sure the partial class is actually compiled as a Blazor component.

I can not create complete application as it is from scratch in RB4VS so it is from RBS. But errors are detected in VS with RB4VS and yes analyze detects following:

.NET SDK:
 Version:           10.0.400
 Commit:            14fbf8d527
 Workload version:  10.0.400-manifests.b0ae88bd
 MSBuild version:   18.9.6+14fbf8d52

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26200
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.400\

.NET workloads installed:
 [android]
   Installation Source: VS 18.9.12105.275
   Manifest Version:    36.1.69/10.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.android\36.1.69\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 18.9.12105.275
   Manifest Version:    26.5.10301/10.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maccatalyst\26.5.10301\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 18.9.12105.275
   Manifest Version:    26.5.10301/10.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.ios\26.5.10301\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: VS 18.9.12105.275
   Manifest Version:    10.0.20/10.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.20\WorkloadManifest.json
   Install Type:              Msi

Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
  Version:      10.0.11
  Architecture: x64
  Commit:       e2f47b0110

.NET SDKs installed:
  7.0.317 [C:\Program Files\dotnet\sdk]
  8.0.130 [C:\Program Files\dotnet\sdk]
  9.0.120 [C:\Program Files\dotnet\sdk]
  9.0.200 [C:\Program Files\dotnet\sdk]
  9.0.317 [C:\Program Files\dotnet\sdk]
  10.0.400 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.30 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.11 [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:
  DOTNET_CLI_UI_LANGUAGE                   [en-US]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Analyzing E:\projekti\TestBuild\NewAppNET9.sln ...
Radzen.Server.CompilationFailedException: E:\projekti\TestBuild\Components\Pages\AddPartneri.razor.cs(35,39): error CS0115: 'AddPartneri.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\AddKonto.razor.cs(35,39): error CS0115: 'AddKonto.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\AddKursevi.razor.cs(35,39): error CS0115: 'AddKursevi.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\EditKursevi.razor.cs(38,39): error CS0115: 'EditKursevi.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\EditKonto.razor.cs(38,39): error CS0115: 'EditKonto.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\EditPartneri.razor.cs(38,39): error CS0115: 'EditPartneri.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\Konto.razor.cs(50,39): error CS0115: 'Konto.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\Kursevi.razor.cs(50,39): error CS0115: 'Kursevi.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Components\Pages\Partneri.razor.cs(50,39): error CS0115: 'Partneri.OnInitializedAsync()': no suitable method found to override
E:\projekti\TestBuild\Program.cs(43,24): error CS0246: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)
E:\projekti\TestBuild\Components\Pages\Kursevi.razor.cs(57,33): error CS0311: The type 'NewAppNET9.Components.Pages.AddKursevi' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.AddKursevi' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Partneri.razor.cs(57,33): error CS0311: The type 'NewAppNET9.Components.Pages.AddPartneri' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.AddPartneri' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Konto.razor.cs(58,33): error CS0311: The type 'NewAppNET9.Components.Pages.AddKonto' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.AddKonto' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Kursevi.razor.cs(63,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditKursevi' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditKursevi' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Konto.razor.cs(64,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditKonto' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditKonto' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\TestBuild\Components\Pages\Partneri.razor.cs(63,33): error CS0311: The type 'NewAppNET9.Components.Pages.EditPartneri' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'NewAppNET9.Components.Pages.EditPartneri' to 'Microsoft.AspNetCore.Components.IComponent'.

   at Radzen.Server.ProjectContext.Compile(Compilation compilation, AssemblyLoadContext context) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectContext.cs:line 211
   at Radzen.Server.ProjectContext.Compile(Compilation compilation) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectContext.cs:line 246
   at Radzen.Server.ProjectContext.<Rebuild>b__104_1() in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectContext.cs:line 409
   at Radzen.Server.LoggerExtensions.Measure[T](ILogger logger, String name, Func`1 action) in D:\a\radzen-next\radzen-next\Radzen.Server\Logger.cs:line 103
   at Radzen.Server.ProjectContext.Rebuild(Boolean throwOnBuildError) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectContext.cs:line 409
   at Radzen.Server.ProjectContext.Rebuild(Boolean throwOnBuildError) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectContext.cs:line 424
   at Radzen.Server.LoggerExtensions.MeasureAsync(ILogger logger, String name, Func`1 action) in D:\a\radzen-next\radzen-next\Radzen.Server\Logger.cs:line 118
   at Radzen.Server.SolutionContext.BuildAllProjects(Boolean throwOnBuildError) in D:\a\radzen-next\radzen-next\Radzen.Server\SolutionContext.cs:line 377
   at Radzen.Server.SolutionContext.BuildAsync(String fileName, Boolean throwOnBuildError, String framework) in D:\a\radzen-next\radzen-next\Radzen.Server\SolutionContext.cs:line 336
   at Radzen.Server.SolutionFacade.LoadProject(String filePath, Boolean overrideLifeCycle, Boolean throwOnBuildError) in D:\a\radzen-next\radzen-next\Radzen.Server\SolutionFacade.cs:line 92
   at Radzen.Server.LoggerExtensions.MeasureAsync[T](ILogger logger, String name, Func`1 action) in D:\a\radzen-next\radzen-next\Radzen.Server\Logger.cs:line 95
   at Radzen.Server.ProjectAnalyzer.AnalyzeAsync(String path, IServiceProvider serviceProvider, Boolean parallel, Boolean all, Boolean load) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectAnalyzer.cs:line 177
Finished with errors.

Here is a test .NET 9 app that I tried. I scaffolded some MSSQL CRUD pages and updated the OnInitializedAsync method of one of them. I couldn't reproduce the error.
Net9AppToTest.zip (239.0 KB)

I need you to answer the following questions in order to proceed as I cannot reproduce this problem:

  1. Can you try with my app?
  2. Which version of RB4VS are you using?
  3. Can you send us the TestBuild app so we can analyze it? Delete the bin and obj directories, zip it and attach it to this thread.

Hi @Djordje,

Got your TestBuild app and analyzed it. It builds and opens without any errors with the current versions of Radzen Blazor Studio and Radzen Blazor for Visual Studio.

We can reproduce your exact error log only with an older version. This is a known incompatibility with .NET SDK 10.0.400 which was fixed in Radzen Blazor Studio 1.70.5 and Radzen Blazor for Visual Studio 1.42.8:

Applications fail to load with error CS0246 "The type or namespace name 'App' could not be found" when .NET SDK 10.0.400 is installed.

Please update both products to the latest version and try again.

I am currently using RB4VS 1.42.7

Your application compiling with no issue but when I try to open source it looks like this:

Starting Radzen.Server on port 4003
Connected to Radzen.Server
Waiting for any pending restore operations...
Restore complete.
Solution is up to date.
Opening project E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Net9AppToTest.sln
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Index.razor.cs(20,33): error CS0115: 'Index.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\AddOrder.razor.cs(35,39): error CS0115: 'AddOrder.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\EditProduct.razor.cs(38,39): error CS0115: 'EditProduct.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\AddProduct.razor.cs(35,39): error CS0115: 'AddProduct.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\AddOrderDetail.razor.cs(35,39): error CS0115: 'AddOrderDetail.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\EditOrder.razor.cs(38,39): error CS0115: 'EditOrder.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\EditOrderDetail.razor.cs(38,39): error CS0115: 'EditOrderDetail.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Products.razor.cs(39,39): error CS0115: 'Products.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Orders.razor.cs(39,39): error CS0115: 'Orders.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\OrderDetails.razor.cs(39,39): error CS0115: 'OrderDetails.OnInitializedAsync()': no suitable method found to override
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Index.razor.cs(23,25): error CS0117: 'object' does not contain a definition for 'OnInitializedAsync'
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Program.cs(42,24): error CS0246: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\OrderDetails.razor.cs(48,33): error CS0311: The type 'Net9AppToTest.Components.Pages.AddOrderDetail' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'Net9AppToTest.Components.Pages.AddOrderDetail' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Orders.razor.cs(46,33): error CS0311: The type 'Net9AppToTest.Components.Pages.AddOrder' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'Net9AppToTest.Components.Pages.AddOrder' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Products.razor.cs(46,33): error CS0311: The type 'Net9AppToTest.Components.Pages.AddProduct' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'Net9AppToTest.Components.Pages.AddProduct' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Products.razor.cs(52,33): error CS0311: The type 'Net9AppToTest.Components.Pages.EditProduct' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'Net9AppToTest.Components.Pages.EditProduct' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\OrderDetails.razor.cs(54,33): error CS0311: The type 'Net9AppToTest.Components.Pages.EditOrderDetail' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'Net9AppToTest.Components.Pages.EditOrderDetail' to 'Microsoft.AspNetCore.Components.IComponent'.
E:\projekti\Atanas\Net9AppToTest\Net9AppToTest\Components\Pages\Orders.razor.cs(52,33): error CS0311: The type 'Net9AppToTest.Components.Pages.EditOrder' cannot be used as type parameter 'T' in the generic type or method 'DialogService.OpenAsync<T>(string, Dictionary<string, object?>?, DialogOptions?)'. There is no implicit reference conversion from 'Net9AppToTest.Components.Pages.EditOrder' to 'Microsoft.AspNetCore.Components.IComponent'.

This is probably the problem - the latest version is 1.42.8 and addresses the reported issue.

The problem is gone.