You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NETSDKE2E][Regression]Error: Failed to load template from "C:\xxx\microsoft.maui.templates.net10.10.0.20.nupkg(/content/templates/maui-blazor-solution/.template.config/template.json)" displays when running command in CLI for the first time. #10047
RGRESSION INFO
not repro on VS 18.6 Insiders [11617.261.main] + 11.0.100-preview.3.26166.111 (runtime- 11.0.0-preview.3.26166.111)
not repro in CLI when only installed Insiders VS 18.6 [11618.325.main]
INSTALL STEPS
Insiders VS 18.6 [11618.325.main] + 11.0.100-preview.3.26168.106 (runtime- 11.0.100-preview.3.26168.106) on win-x64
REPRO STEPS
1.In CLI, run the dotnet command for the first time, e.g dotnet new sln
ACTUAL
sln is created successfully,but below error happens
Error: Failed to load template from "C:\Program Files\dotnet\template-packs\microsoft.maui.templates.net10.10.0.20.nupkg(/content/templates/maui-blazor-solution/.template.config/template.json)".
Details: System.ArgumentException: An item with the same key has already been added. Key: empty (Parameter 'key')
at System.Collections.ThrowHelper.ThrowDuplicateKey[TKey](TKey key)
at System.Collections.Generic.OrderedDictionary2.TryInsert(Int32 index, TKey key, TValue value, InsertionBehavior behavior, Int32& keyIndex) at System.Collections.Generic.OrderedDictionary2.Add(TKey key, TValue value)
at System.Text.Json.Nodes.JsonObject.InitializeDictionary()
at System.Text.Json.Nodes.JsonObject.get_Count()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ConfigModel.TemplateConfigModel..ctor(JsonObject source, ILogger logger, String baselineName) at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.DirectoryBasedTemplate..ctor(IEngineEnvironmentSettings settings, IGenerator generator, IFile templateFile, String baselineName) at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectGenerator.GetTemplatesFromMountPointInternalAsync(IMountPoint source, CancellationToken cancellationToken) Error: Failed to load template from "C:\Program Files\dotnet\template-packs\microsoft.maui.templates.net10.10.0.20.nupkg(/content/templates/maui-blazor/.template.config/template.json)". Details: System.ArgumentException: An item with the same key has already been added. Key: empty (Parameter 'key') at System.Collections.ThrowHelper.ThrowDuplicateKey[TKey](TKey key) at System.Collections.Generic.OrderedDictionary2.TryInsert(Int32 index, TKey key, TValue value, InsertionBehavior behavior, Int32& keyIndex)
at System.Collections.Generic.OrderedDictionary2.Add(TKey key, TValue value) at System.Text.Json.Nodes.JsonObject.InitializeDictionary() at System.Text.Json.Nodes.JsonObject.get_Count() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ConfigModel.TemplateConfigModel..ctor(JsonObject source, ILogger logger, String baselineName)
at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.DirectoryBasedTemplate..ctor(IEngineEnvironmentSettings settings, IGenerator generator, IFile templateFile, String baselineName)
at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectGenerator.GetTemplatesFromMountPointInternalAsync(IMountPoint source, CancellationToken cancellationToken)
Expected Result:
sln is created successfully without any erros
Note:
1.We don't meet it in CLI when only installing SDK
2.it not happens when running command in CLI for the second time
changed the title [-][NETSDKE2E]Error: Failed to load template from "C:\xxx\microsoft.maui.templates.net10.10.0.20.nupkg(/content/templates/maui-blazor-solution/.template.config/template.json)" displays when running command in CLI for the first time.[/-][+][NETSDKE2E][Regression]Error: Failed to load template from "C:\xxx\microsoft.maui.templates.net10.10.0.20.nupkg(/content/templates/maui-blazor-solution/.template.config/template.json)" displays when running command in CLI for the first time.[/+]on Mar 19, 2026
@marcpopMSFT is this an issue in the .NET SDK that needs to be looked at for .NET 11 P3? From Nicole's scenario above, this reproduces when only .NET SDK is installed and even the install of VS is not necessary.
Activity
[-][NETSDKE2E]Error: Failed to load template from "C:\xxx\microsoft.maui.templates.net10.10.0.20.nupkg(/content/templates/maui-blazor-solution/.template.config/template.json)" displays when running command in CLI for the first time.[/-][+][NETSDKE2E][Regression]Error: Failed to load template from "C:\xxx\microsoft.maui.templates.net10.10.0.20.nupkg(/content/templates/maui-blazor-solution/.template.config/template.json)" displays when running command in CLI for the first time.[/+]NicoleWang001 commentedon Mar 23, 2026
I also met the issue with .NET 11.0.100-preview.3.26172.107 on Fedora 43 Linux
balachir commentedon Mar 25, 2026
@marcpopMSFT is this an issue in the .NET SDK that needs to be looked at for .NET 11 P3? From Nicole's scenario above, this reproduces when only .NET SDK is installed and even the install of VS is not necessary.
marcpopMSFT commentedon Mar 25, 2026
Moving to templating because that's where the callstack is from.
marcpopMSFT commentedon Mar 25, 2026
same as #10025
marcpopMSFT commentedon Mar 25, 2026
This will need to flow to dotnet/dotnet and get a new build before it can be tested E2E
vdanche commentedon Mar 26, 2026
currently the fix is not mergered into 11.0.100-preview.3.26174.105 SDK, will verify on the new build.

vdanche commentedon Apr 7, 2026
This issue is fixed on 11.0.100-preview.3.26203.107 (runtime- 11.0.0-preview.3.26203.107)