templating
templating copied to clipboard
Provide an easy way to insert the Nuget Package Version into item templates contained within that package
Is your feature request related to a problem? Please describe.
I am trying to include the nuget version in the item templates that are generated using that package (i.e. I'm trying to make the item templates that are created from my package versioned, with the same version number as the nuget package where the template package came from).
Describe the solution you'd like.
I'd like to be able to include a simple, built-in replaceable string in any files that are included in my templates, such that when the template is created using dotnet new, the files that are generated would contain the nuget package version in place of that string.
Additional context
For common code that is created/update from dotnet templates, being able to have the nuget package version automatically added to those template files the way the template author wants (wherever they place a built-in, replaceable string) would be very handy so that anyone looking at the files that were generated would know what package version those files came from. As templates are shared across an organization with many different developers/teams, it is important to know the source version of those files so that developers can identify when they should be updated (i.e. if the nuget package has a much newer version available, it could be time to update the common code that was generated from a template).