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.

Enabling create items from templates also without installing it

See original GitHub issue

Was thinking, it would enable a lot of ease and usage if the templates can be used without installing it using dotnet new. Can we just use those templates directly from the nugets or a folder to create those items derived from the templates. It may be available now, not sure, but I could not see any available solution for the same.


Audience: dotnet CLI users

Background

Now to instantiate any template you need to install the package containing it first. The packages are not updated automatically, and it’s user responsibility to keep the up-to-date. To check updates the user needs to use update command or will be prompted only after outdated template is created. In many cases, when acquiring new template, it would be beneficial to try it first to see if it matches your needs. Now it is a 3 step process:

  • install the template package
  • instantiate the template
  • uninstall the template package

Justification

  • even better experience for CLI users
    • easy option to “try it out” before installing the package
    • avoid running outdated templates - always use latest from the source
  • popular tools like npx has this experience

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
baronfelcommented, Nov 9, 2021

This would be really useful for enabling npx-style usage of templates. Project templates especially you often want to use the latest version on each invocation, and a fire-and-forget experience to run the template without having to do the initial install step can really lower the friction to get started. It also addresses the maintenance aspect of community templates - in the current method you have to update template packages before each invocation if you want to make sure you have the latest. npx-style invocation would (effectively) do an install, invoke, cleanup process to ensure that you always have the latest versions.

1reaction
vlada-shubinacommented, Jul 26, 2021

@satyajit-behera

do you mean something like this? > dotnet new my-template --from MyNuGetPack::1.0.0 - runs my-template available in MyNuGetPack nuget.org package (version 1.0.0) > dotnet new my-template --from MyFolder - runs my-template from local folder MyFolder

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a catalog item using a template
Select a template from the list and click Use this item template. Note: After you select the template, the preview of this template...
Read more >
Creating Custom Project and Item Templates - Visual ...
Learn how template creation templates in the Visual Studio SDK let you include templates in larger extensions.
Read more >
Templates for projects and files - Visual Studio (Windows)
You can use installed templates, author your own custom templates, or download and use templates created by the community. For more information, ...
Read more >
Turn custom Drive templates on or off for users
Check the Enable custom templates for your organization box. Click Save. Create or remove template categories. Set up template categories so users can...
Read more >
Item templates for creating new Items
To make an item template based on an existing item, press on actions, functions and save as template.
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