Is there a known fix for opening Radzen projects(.net 9) created in VS2022 when using VS2026? I continue to experience the error shown below, despite having the latest Radzen extension (1.29.2) and VS2026 (18.0.1), and after attempting to clean, rebuild, and reopen the project.
This isn't a known issue and we can't reproduce it in local tests for some reason.
- Can you send us this app so we can troubleshoot? If yes zip everything up (but delete bin and obj directories) and send it to info@radzen.com.
- If not I think creating an empty VS2026 solution and then adding the existing projects (.csproj files) to it should work.
Thank you for the update.
I’m currently preparing and sending the zipped project (with the bin and obj folders removed) to info@radzen.com as requested. I also tried your suggestion to create a new solution. It worked at first, but after reopening the project, the error still occurred.
The only issue I see in the project you've sent is that MainLayout.razor is invalid for some reason. It contains the following code which I don't recognize:
{
"Scenario": "Default",
"Type": "TrainingConfig",
"Version": 3
}
This of course makes it invalid .razor file. Do you know what could have updated the MainLayout.razor file like that? I see from your screenshot that something different has opened the MainLayout.razor file and the logs show it didn't recognize the .razor extension either and failed to open it with that error message. I suspect that ML plugin is messing things up for some reason. What are the contents of this log file from the output pane?
In any case restoring the default contents of MainLayout.razor made the app build and display just fine in Visual Studio 2026:
Here is what those contents are:
@inherits LayoutComponentBase
@inject CookieThemeService CookieThemeService
<RadzenComponents />
<RadzenLayout>
<RadzenHeader>
<RadzenRow JustifyContent="JustifyContent.Start" AlignItems="AlignItems.Center" Gap="0">
<RadzenColumn Size="5">
<RadzenSidebarToggle Click="@SidebarToggleClick"></RadzenSidebarToggle>
</RadzenColumn>
<RadzenColumn Size="7">
<RadzenStack AlignItems="AlignItems.Center" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" Gap="0.5rem" class="rz-px-2">
<RadzenAppearanceToggle />
</RadzenStack>
</RadzenColumn>
</RadzenRow>
</RadzenHeader>
<RadzenBody Expanded="@sidebarExpanded">
<RadzenRow class="rz-mx-auto rz-px-4 rz-pt-2 rz-pt-md-4 rz-pt-lg-6 rz-pt-xl-12 rz-pb-2 rz-pb-lg-12" Style="max-width: 1440px;">
<RadzenColumn Size="12">
@Body
</RadzenColumn>
</RadzenRow>
</RadzenBody>
<RadzenSidebar @bind-Expanded="@sidebarExpanded">
<RadzenStack AlignItems="Radzen.AlignItems.Center" class="rz-py-4 rz-py-lg-6" Style="padding: var(--rz-panel-menu-item-padding); border-bottom: var(--rz-panel-menu-item-border);">
<RadzenImage Path="images/logo.png" style="width: 48px; height: 48px;" AlternateText="Application logo"></RadzenImage>
<RadzenText Text="RadzenBlazorApp2" TextStyle="Radzen.Blazor.TextStyle.Subtitle1" class="rz-mb-0" style="color: var(--rz-sidebar-color);" />
</RadzenStack>
<RadzenPanelMenu>
<RadzenPanelMenuItem Text="Home" Path="" />
</RadzenPanelMenu>
<RadzenStack AlignItems="Radzen.AlignItems.Center" Gap="0" class="rz-py-4 rz-py-lg-6" Style="padding: var(--rz-panel-menu-item-padding);">
<RadzenText Text="RadzenBlazorApp2 v1.0.0" TextStyle="Radzen.Blazor.TextStyle.Caption" TagName="Radzen.Blazor.TagName.P" TextAlign="Radzen.TextAlign.Center" />
<RadzenText Text="Copyright â’¸ 2025" TextStyle="Radzen.Blazor.TextStyle.Caption" class="rz-mb-0" TagName="Radzen.Blazor.TagName.P" TextAlign="Radzen.TextAlign.Center" />
</RadzenStack>
</RadzenSidebar>
</RadzenLayout>
Can you try uninstalling the Radzen VS plugin and installing it again in VS2026? It could be that some other plugin has taken precedence for some reason over the .razor extension and erroneously to open it.
I have also found this thread which seems to be the exact same issue - opening a .razor file in VS loads the ml.net Scenario Select Window. It shows the exact same error message as in your screenshot. It seems the problem isn't related to Radzen Blazor for Visual Studio.
Thanks for the update. I just reopened the project, and the .razor file was again modified with invalid Razor code. What I did was create an empty Razor page, and after that, the unrecognized .razor file was resolved. I have to do this every time I open the project. Maybe this is the problem with VS2026. I will try to reinstall the IDE and the Radzen Extension.
Can you also try repeating the same process when the Radzen extension is uninstalled? I suspect the problem is rooted deeper in the VS2026 configuration and actually somehow related to the ML.NET extension.
I have the same issue. I got around it - for now - by using the insiders edition of VS 2026. If I use the regular edition of VS 2026, it somehow thinks that each razor file that I open is an ML.NET file, and then it overwrites it with that strange “trainingconfig” file that you posted earlier. If I don’t open up a razor file in VS 2026, then the program compiles and executes just fine. I am not using Machine Learning, so I don’t know why ML.NET is involved. Maybe that is some new default configuration setting in VS 2026. The regular Radzen Blazor Studio continues to work just fine. VS 2022 works fine. I am using .NET 10 if that matters.
Hi @mherman,
Does the problem appear if you uninstall or disable the Radzen extension? The thread I've linked reports the same issue but never mentions our extension so I wonder if the problem is a generic VS2026 issue.
Thanks for looking at this. Disabling the extension did allow me to open the razor files in the project. Syntax highlighting and Intellisense works, so VS 2026 recognizes it properly.
Just now, I tried using “enable” to restart the extension, but that did not appear to turn it back on. So I uninstalled and then reinstalled the extension as you suggested earlier in this thread and now everything is working. If it matters, I had version 1.29.1 before, and now I have 1.30.1.
Thanks for all your help @korchev
Hi @mherman,
It seems reinstalling the extension fixes the problem. For some reason VS2026 gets confused what editor to launch for .razor files and picks ML.NET instead of the default one or Radzen's.
If this happens again you can right click a .razor file and select Open with.... Then inspect the list of editors and what the default is (and possibly change it).
I think I found what the problem is and it is hilarious. Turns out both the ML.NET editor and the Radzen Blazor editor used the same GUID
(taken from an open source sample project on github). This made VS load the ML.NET editor for the .razor extension in some cases (depending of the order it loads the extensions). Anyway the next release 1.30.2 should hopefully fix this annoying problem once and for all.

