Skip to content

Instantly share code, notes, and snippets.

@rmarinho
Last active April 30, 2026 10:44
Show Gist options
  • Select an option

  • Save rmarinho/88491868ebefbb78900334c638376df9 to your computer and use it in GitHub Desktop.

Select an option

Save rmarinho/88491868ebefbb78900334c638376df9 to your computer and use it in GitHub Desktop.
Error with templates
11.0.100-preview.4.26224.122 [C:\Program Files\dotnet\sdk]
PS C:\Users\rumar> q:
PS Q:\> cd .\source\
PS Q:\source> dotnet new maui -o MauiAppNet10
Error: Failed to load template from "C:\Program Files\dotnet\templates\6.0.36\microsoft.dotnet.test.projecttemplates.6.0.1.0.2-beta4.22207.1.nupkg(/content/NUnit-CSharp/.template.config/template.json)".
Details: System.ArgumentException: An item with the same key has already been added. Key: defaultName (Parameter 'key')
at System.Collections.ThrowHelper.ThrowDuplicateKey[TKey](TKey key)
at System.Collections.Generic.OrderedDictionary`2.TryInsert(Int32 index, TKey key, TValue value, InsertionBehavior behavior, Int32& keyIndex)
at System.Collections.Generic.OrderedDictionary`2.Add(TKey key, TValue value)
at System.Text.Json.Nodes.JsonObject.InitializeDictionary()
at System.Text.Json.Nodes.JsonObject.TryGetPropertyValue(String propertyName, JsonNode& jsonNode, Int32& index)
at System.Text.Json.Nodes.JsonObject.TryGetPropertyValue(String propertyName, JsonNode& jsonNode)
at Microsoft.TemplateEngine.JExtensions.GetPropertyCaseInsensitive(JsonObject obj, String key)
at Microsoft.TemplateEngine.JExtensions.Get[T](JsonNode token, String key)
at Microsoft.TemplateEngine.JExtensions.ArrayAsStrings(JsonNode token, String propertyName)
at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.DirectoryBasedTemplate.MergeAdditionalConfiguration(JsonObject primarySource, IFileSystemInfo primarySourceConfig)
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\templates\6.0.36\microsoft.dotnet.test.projecttemplates.6.0.1.0.2-beta4.22207.1.nupkg(/content/NUnit-FSharp/.template.config/template.json)".
Details: System.ArgumentException: An item with the same key has already been added. Key: defaultName (Parameter 'key')
at System.Collections.ThrowHelper.ThrowDuplicateKey[TKey](TKey key)
at System.Collections.Generic.OrderedDictionary`2.TryInsert(Int32 index, TKey key, TValue value, InsertionBehavior behavior, Int32& keyIndex)
at System.Collections.Generic.OrderedDictionary`2.Add(TKey key, TValue value)
at System.Text.Json.Nodes.JsonObject.InitializeDictionary()
at System.Text.Json.Nodes.JsonObject.TryGetPropertyValue(String propertyName, JsonNode& jsonNode, Int32& index)
at System.Text.Json.Nodes.JsonObject.TryGetPropertyValue(String propertyName, JsonNode& jsonNode)
at Microsoft.TemplateEngine.JExtensions.GetPropertyCaseInsensitive(JsonObject obj, String key)
at Microsoft.TemplateEngine.JExtensions.Get[T](JsonNode token, String key)
at Microsoft.TemplateEngine.JExtensions.ArrayAsStrings(JsonNode token, String propertyName)
at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.DirectoryBasedTemplate.MergeAdditionalConfiguration(JsonObject primarySource, IFileSystemInfo primarySourceConfig)
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\templates\6.0.36\microsoft.dotnet.test.projecttemplates.6.0.1.0.2-beta4.22207.1.nupkg(/content/NUnit-VisualBasic/.template.config/template.json)".
Details: System.ArgumentException: An item with the same key has already been added. Key: defaultName (Parameter 'key')
at System.Collections.ThrowHelper.ThrowDuplicateKey[TKey](TKey key)
at System.Collections.Generic.OrderedDictionary`2.TryInsert(Int32 index, TKey key, TValue value, InsertionBehavior behavior, Int32& keyIndex)
at System.Collections.Generic.OrderedDictionary`2.Add(TKey key, TValue value)
at System.Text.Json.Nodes.JsonObject.InitializeDictionary()
at System.Text.Json.Nodes.JsonObject.TryGetPropertyValue(String propertyName, JsonNode& jsonNode, Int32& index)
at System.Text.Json.Nodes.JsonObject.TryGetPropertyValue(String propertyName, JsonNode& jsonNode)
at Microsoft.TemplateEngine.JExtensions.GetPropertyCaseInsensitive(JsonObject obj, String key)
at Microsoft.TemplateEngine.JExtensions.Get[T](JsonNode token, String key)
at Microsoft.TemplateEngine.JExtensions.ArrayAsStrings(JsonNode token, String propertyName)
at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.DirectoryBasedTemplate.MergeAdditionalConfiguration(JsonObject primarySource, IFileSystemInfo primarySourceConfig)
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)
The template ".NET MAUI App" was created successfully.
Processing post-creation actions...
Restoring Q:\source\MauiAppNet10\MauiAppNet10.csproj:
Restore succeeded with 1 warning(s) in 4.0s
Q:\source\MauiAppNet10\MauiAppNet10.csproj : warning NU1603: MauiAppNet10 depends on Microsoft.Extensions.Logging.Debug (>= 11.0.0-preview.1.26079.116) but Microsoft.Extensions.Logging.Debug 11.0.0-preview.1.26079.116 was not found. Microsoft.Extensions.Logging.Debug 11.0.0-preview.1.26104.118 was resolved instead.
Restore succeeded.
PS Q:\source> dotnet --list-sdks
8.0.400 [C:\Program Files\dotnet\sdk]
8.0.420 [C:\Program Files\dotnet\sdk]
9.0.116 [C:\Program Files\dotnet\sdk]
10.0.107 [C:\Program Files\dotnet\sdk]
10.0.203 [C:\Program Files\dotnet\sdk]
10.0.300-preview.0.26217.103 [C:\Program Files\dotnet\sdk]
11.0.100-preview.4.26224.122 [C:\Program Files\dotnet\sdk]
PS Q:\source> dotnet workload list
Workload version: 11.0.100-manifests.e88583fc
Installed Workload Id Manifest Version Installation Source
---------------------------------------------------------------------------------------------------------------------
android 36.1.99-preview.1.119/11.0.100-preview.1 SDK 11.0.100-preview.4, VS 18.5.11723.231
ios 26.2.11310-net11-p1/11.0.100-preview.1 SDK 11.0.100-preview.4, VS 18.5.11723.231
maccatalyst 26.2.11310-net11-p1/11.0.100-preview.1 SDK 11.0.100-preview.4, VS 18.5.11723.231
maui 11.0.0-preview.1.26102.3/11.0.100-preview.1 SDK 11.0.100-preview.4
maui-windows 11.0.0-preview.1.26102.3/11.0.100-preview.1 SDK 11.0.100-preview.4, VS 18.5.11723.231
Use `dotnet workload search` to find additional workloads to install.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment