Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to show and choose templates that are not installed locally #1680

Closed
AndrewBrianHall opened this issue Oct 15, 2018 · 9 comments
Closed
Labels
need-customer-info Requires feedback from author size:5.0 triaged The issue was evaluated by the triage team, placed on correct area, next action defined.

Comments

@AndrewBrianHall
Copy link

For .NET Core 3.0, ASP.NET Core wants to ability to have templates that are never installed locally (due to various dependencies that are difficult to keep up to date) but appear as options for dotnet new and then use a cloud copy when chosen.

@sayedihashimi
Copy link
Member

Please keep me posted if you add this ability to VS(Windows). I'd like to add it to VSMac at the same time if possible.

@mlorbetske
Copy link
Contributor

This would be an engine feature and would apply to the CLI, so this would be a new drop of the NuGet packages

@mlorbetske mlorbetske added this to the .NET Core 3.0 milestone Oct 22, 2018
@hacst
Copy link

hacst commented Mar 27, 2019

It would be great if this was also something that can be easily used with private nuget servers. The current workflow for using private templates inside a company feels quite clunky to me.

For comparison in the maven/java world the "equivalent" would be maven archetypes. There you configure an archetype repository in a central config once. This allows maven to automatically pick up all templates (aka archetypes) and versions when it comes to searching and selecting a template. No explicit local installation or updates required. No need to explicitely re-state feeds with every invocation. Having the same convenience with dotnet new would be very handy.

@rwkarg
Copy link

rwkarg commented Sep 12, 2019

We host templates on an internal NuGet feed as well. I'm not aware of a way to ensure that the most up to date template is installed aside from either browsing the NuGet repository to get the latest version and explicitly installing that (dotnet new -i MyTemplate::1.2.3) or by uninstalling and installing the template every time it's used.

@donJoseLuis donJoseLuis removed this from the .NET Core 3.0 milestone Mar 19, 2020
@donJoseLuis donJoseLuis added needsprioritization triaged The issue was evaluated by the triage team, placed on correct area, next action defined. labels Mar 19, 2020
@AR-May AR-May added the need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases label Sep 29, 2020
@vlada-shubina vlada-shubina removed the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label Apr 13, 2021
@KathleenDollard
Copy link

It's been a while since this issue has had any comments. Are folks still interested?

One of several issues in doing this is that a NuGet package may contain numerous templates. Thus, the command would have to include the package Id and the template name (maybe dropping the second if there is only one template). And we'd have to manage help for this scenario, and it would be slow.

How does this relate to managing private servers? Is it just that if you are managing a private server you really want to ensure that people are using the version of the template you have on your server?

Is the actual goal here to ensure users do not use an out of date template?

@KathleenDollard KathleenDollard added the need-customer-info Requires feedback from author label Apr 13, 2021
@hacst
Copy link

hacst commented Apr 13, 2021

Definitely still interested. The use case for sourcing from a private server are purely company internal templates for new services and libraries.

The goal would be to solve both the discovery as well as the update problematic. Users currently cannot discover private templates using normal tooling and if they manually installed a template in the past they are not made aware of updated versions the next time they instantiate the template.

Not installing the template and instead being able to discover the current one in the repository and instantiate it directly sounded like it could solve both of these problems.

@bekir-ozturk bekir-ozturk added the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label Apr 26, 2021
@baronfel
Copy link
Member

Checking in here - currently we

  • check for updated nuget package versions when a template from a nuget package is instanciated
  • supply the dotnet new --update-check command (and in .NET 7 the dotnet new update --check-only command) to allow users to see if there are updates (optionally can apply them automatically with dotnet new --update-apply (and in .NET 7 dotnet new update)

These both work off of the configured NuGet sources, so a properly-configured NuGet.config should allow for updates from private servers.

The remaining request seems to be for automated or semi-automated install of a template package if instanciating a package :

  • that's not installed
  • that's known to be in a template package that's available

This is doable for template packages that live on nuget.org, and something like this (npx-style download + run) is something I've wanted to do for a while. The gap is for having this same experience with private NuGet feeds. @vlada-shubina to support that, we'd probably have to be able to index the private feed (perhaps locally via a direct user command?) and select/merge the indexes with the larger nuget.org index?

@baronfel baronfel removed the need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases label Apr 18, 2022
@vlada-shubina
Copy link
Member

This issue seems to raise several points.

  • update for packages from private feeds
    This was already addressed and fixed in .NET 6. Checking for update from private NuGet feeds are now supported. It might be slightly complicated in case NuGet feed needs interactive authentication as the check for update will fail on template instantiation, however interactive mode is supported with update and update --check (formerly --update-check).

  • ability to run templates without installation
    We have a separate issue for that: Enable automatic install of templates on first use #3418
    Let me know if we need a separate feature when template will be installed on first run - I would like to create the separate issue for it and close this one.

@vlada-shubina
Copy link
Member

Closing in favor of #3418. Please follow this issue if you are interested in running templates that are not installed locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-customer-info Requires feedback from author size:5.0 triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
None yet
Development

No branches or pull requests