question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to pick up certain template group or certain template to be run in case of ambiguity

See original GitHub issue

At the moment 2 cases for ambiguity may happen during template instantiation:

  • different template groups may have same short name
  • different templates in one group may have same precedence and it is not possible to determine the one to be run

Those cases may be solved by uninstalling one of the packages in template groups are coming from different packages, however if they are coming from single one the situation cannot be resolved.

Suggesting the following options to resolve these conflicts:

  • --group allows to specify group identity to run
  • --identity allows to specify template identity to run

The error cases should be modified as following: (ambiguous group) Unable to resolve the template, these templates matched your input:

Name Short name Group
Template 1 short Group.Identity1
Template 2 short Group.Identity2

To run specific template, specify its group using --group option. dotnet new short --group Group.Identity1.

(ambiguous template) Unable to resolve the template, these templates matched your input:

Name Short name Identity
Template 1 short Templ.Identity1
Template 2 short Templ.Identity2

This may happen due to authoring error or ambiguous parameter set. To run specific template, specify the identity using --identity option. dotnet new short --identity Templ.Identity1

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sayedihashimicommented, Apr 12, 2022

For the Authoring case, I think this should be a warning and not an error.

1reaction
sayedihashimicommented, Nov 23, 2021

I ran my tool to identify templates that re-use the identity value across templates.

I only found 4 IDs that are actually being used in different templates.

template-pack-id						identity
Microsoft.DotNet.Web.ItemTemplates		Microsoft.Web.Grpc.Protobuf
Microsoft.DotNet.Web.ItemTemplates.6.0	Microsoft.Web.Grpc.Protobuf
VijayAnand.BlazorTemplates				VijayAnand.WindowsForms.Blazor
VijayAnand.BlazorTemplates				VijayAnand.Wpf.Blazor

My report did include the following as well, but that is due to this bug https://github.com/dotnet/templating/issues/4140. Those are listed below.

template-pack-id						identity
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Item.SpecFlowFeature
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Item.SpecFlowConfiguration
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Item.SpecFlowPlusProfile
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Project
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Item.SpecFlowFeature
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Item.SpecFlowConfiguration
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Item.SpecFlowPlusProfile
SpecFlow.Templates.DotNet				SpecFlowTemplates.DotNET.Project
Threenine.ApiProject					Threenine.ApiProject
Threenine.ApiProject					Threenine.ApiProject
VijayAnand.Wpf.Blazor					VijayAnand.Wpf.Blazor
VijayAnand.WindowsForms.Blazor			VijayAnand.WindowsForms.Blazor
Laconic.AppTemplate					Laconic.AppTemplate
Laconic.AppTemplate					Laconic.AppTemplate
VijayAnand.BlazorTemplates				VijayAnand.WindowsForms.Blazor
VijayAnand.BlazorTemplates				VijayAnand.Wpf.Blazor
E5R.Architecture.Template				E5R.Architecture.Template.FullSolution
E5R.Architecture.Template				E5R.Architecture.Template.FullSolution
sayedha.templates						Sayedha.Templates.CliTool
sayedha.templates						Sayedha.Templates.IdeHostJson
sayedha.templates						Sayedha.Templates.TemplateJson
sayedha.templates						Sayedha.Templates.TemplatePackJson
sayedha.templates						Sayedha.Templates.CliTool
sayedha.templates						Sayedha.Templates.IdeHostJson
sayedha.templates						Sayedha.Templates.TemplateJson
sayedha.templates						Sayedha.Templates.TemplatePackJson
Read more comments on GitHub >

github_iconTop Results From Across the Web

Template function call ambiguity error - c++
As std::string is an instance of a template class in namespace std , the function template std::min is found via a process called...
Read more >
How To Use Templates in Go
Let's get started. Step 1 — Importing text/template. Suppose you would like to generate a simple report about some data you have on...
Read more >
Resource functions for ARM templates - Azure
Describes the functions to use in an Azure Resource Manager template (ARM template) to retrieve values about resources.
Read more >
7 Tips To Identify and Manage Ambiguity in the Workplace
Examples of ambiguity. It's important to identify ambiguous situations in the workplace to successfully overcome them. Consider some of these ...
Read more >
Acceptance Criteria: Purposes, Types, Examples and Best ...
In case you need some downloadable acceptance criteria templates to quickly fill in the necessary information and organize your user stories, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found