Templates icon indicating copy to clipboard operation
Templates copied to clipboard

Add support for Visual Studio 2026 and .NET 10

Open luronumen opened this issue 2 months ago • 5 comments

Actual Result

  • The MudBlazor template is not listed in Visual Studio 2026
  • dotnet new mudblazor command creates the project to net9

Expected Result

  • The MudBlazor template should be listed in Visual Studio 2026
  • dotnet new mudblazor command should create the project to net10

Steps to Reproduce the Issue

  1. Install the Visual Studio 2026 available at: https://visualstudio.microsoft.com/
  2. Run the following command to install the MudBlazor template: dotnet new install MudBlazor.Templates
  3. Open the Visual Studio 2026: Verify that the MudBlazor template is not listed
  4. Run the following command to create a MudBlazor Server application: dotnet new mudblazor --interactivity Server --name MyApplication --all-interactive: Verifiy that the application is created for net9 instead of net10

luronumen avatar Nov 12 '25 15:11 luronumen

I have the MudBlazor template listed, even without reinstalling it. Image

Perhaps you didn’t select the option to migrate all settings from VS 2022. I’d suggest doing something like this:

dotnet new --uninstall MudBlazor.Templates
dotnet new install MudBlazor.Templates

If it still doesn’t show up, I’d recommend using Send Feedback → Report a Problem in the IDE, as we’re not responsible for the template installation process. There are no special requirements from MSFT for VS 2026, so it should work out of the box.

As for the .NET 10 templates themselves, we probably won’t rush to update them until the next major version of MudBlazor is released. This way, we can avoid having to redo things back and forth, as our resources are limited.

ScarletKuro avatar Nov 12 '25 16:11 ScarletKuro

Hi @ScarletKuro,

Thank you so much for your quick reply!

Exactly! Instead of updating Visual Studio from version 2022 to version 2026, I uninstalled version 2022 and then installed version 2026.

By updating this way, I simulated a clean installation of Visual Studio 2026, which showed that even after installing the template, it is not shown as an option for project creation, as you can see in the images below:

Image Image

This problem is probably happening because when doing a clean installation of Visual Studio 2026, only .NET 10 is installed, and since the template is for .NET 9, it is not listed when creating a new project. Does what I said make sense?

luronumen avatar Nov 13 '25 01:11 luronumen

Same problem here ...

The template seems to only have built-in support for net9.

PowerShell 7.5.4
PS D:\> dotnet new --uninstall MudBlazor.Templates
Warning: use of 'dotnet new --uninstall' is deprecated. Use 'dotnet new uninstall' instead.
For more information, run:
   dotnet new uninstall -h

Success: MudBlazor.Templates::3.2.0 was uninstalled.
PS D:\> dotnet new install MudBlazor.Templates
The following template packages will be installed:
   MudBlazor.Templates

Success: MudBlazor.Templates::3.2.0 installed the following templates:
Template Name   Short Name  Language  Tags
--------------  ----------  --------  --------------------------------
Blazor Web App  mudblazor   [C#]      Web/Blazor/WebAssembly/MudBlazor

PS D:\> dotnet new mudblazor -h
Blazor Web App (C#)
Author: Microsoft
Description: A project template for creating a Blazor web app that supports both server-side rendering and client interactivity. This template can be used for web apps with rich dynamic user interfaces (UIs).

Usage:
  dotnet new mudblazor [options] [template options]

Options:
  -n, --name <name>       The name for the output being created. If no name is specified, the name of the output
                          directory is used.
  -o, --output <output>   Location to place the generated output.
  --dry-run               Displays a summary of what would happen if the given command line were run if it would result
                          in a template creation. [default: False]
  --force                 Forces content to be generated even if it would change existing files. [default: False]
  --no-update-check       Disables checking for the template package updates when instantiating a template. [default:
                          False]
  --project <project>     The project that should be used for context evaluation.
  -lang, --language <C#>  Specifies the template language to instantiate.
  --type <project>        Specifies the template type to instantiate.

Template options:
  -f, --framework <net9.0>                 The target framework for the project.
                                           Type: choice
                                             net9.0  Target net9.0
                                           Default: net9.0
  --no-restore                             If specified, skips the automatic restore of the project on create.
                                           Type: bool
                                           Default: false
  --exclude-launch-settings                Whether to exclude launchSettings.json from the generated template.
                                           Type: bool
                                           Default: false
  -int, --interactivity <None|Server|...>  Chooses which interactive render mode to use for interactive components
                                           Type: choice
                                             None         No interactivity (static server rendering only)
                                             Server       Runs on the server
                                             WebAssembly  Runs in the browser using WebAssembly
                                             Auto         Uses Server while downloading WebAssembly assets, then uses
                                           WebAssembly
                                           Default: WebAssembly
  -e, --empty                              Configures whether to omit sample pages and styling that demonstrate basic
                                           usage patterns.
                                           Type: bool
                                           Default: false
  -au, --auth <Individual|None>            The type of authentication to use
                                           Type: choice
                                             None        No authentication
                                             Individual  Individual authentication
                                           Default: None
  -uld, --use-local-db                     Whether to use LocalDB instead of SQLite. This option only applies if --auth
                                           Individual is specified.
                                           Type: bool
                                           Default: false
  -ai, --all-interactive                   Configures whether to make every page interactive by applying an interactive
                                           render mode at the top level. If false, pages will use static server
                                           rendering by default, and can be marked interactive on a per-page or
                                           per-component basis.
                                           Enabled if: (InteractivityPlatform != "None")
                                           Type: bool
                                           Default: false
  --no-https                               Whether to turn off HTTPS. This option only applies if Individual isn't used
                                           for --auth.
                                           Type: bool
                                           Default: false
  --use-program-main                       Whether to generate an explicit Program class and Main method instead of
                                           top-level statements.
                                           Type: bool
                                           Default: false

PS D:\> dotnet new mudblazor -f net10.0 --no-restore -o .\MudBlazorNet10
Error: Invalid option(s):
-f net10.0
   'net10.0' is not a valid value for -f. The possible values are:
      net9.0   - Target net9.0

For more information, run:
   dotnet new mudblazor -h

For details on the exit code, refer to https://aka.ms/templating-exit-codes#127
PS D:\> dotnet --list-runtimes
Microsoft.AspNetCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
PS D:\> dotnet --list-sdks
9.0.307 [C:\Program Files\dotnet\sdk]
10.0.100-rc.1.25451.107 [C:\Program Files\dotnet\sdk]
10.0.100 [C:\Program Files\dotnet\sdk]

edson-v-schmitt avatar Nov 16 '25 17:11 edson-v-schmitt

Does what I said make sense?

If you have only .NET SDK 10 installed, it makes sense that you don't see it in the VS UI, as it only supports .NET 9. You can install .NET 9, create project and then just manually upgrade it to .NET 10, it will work.

The template seems to only have built-in support for net9.

Yeah, you can create the .net 9 templates and upgrade it.

ScarletKuro avatar Nov 16 '25 18:11 ScarletKuro

Yeah, you can create the .net 9 templates and upgrade it.

Not sure if this was an attempt at a cheeky joke ... but ... if I'm manually upgrading between .net versions then why am I using the template at all?

Anyways ... I'll have a look at the repo and see if I can suggest a PR to add the ability to generate templates in multiple different TFMs.

edson-v-schmitt avatar Nov 17 '25 11:11 edson-v-schmitt