Update an already installed template
See original GitHub issueWhat is is the best way to update an already installed template? (NuGet or File distribution) Should the template be uninstalled and then the new version installed again?
There doesn’t seem to be a --update
flag
Issue Analytics
- State:
- Created 5 years ago
- Comments:28 (11 by maintainers)
Top Results From Across the Web
Update existing templates - Visual Studio
Learn how to use Export Template Wizard and other manual processes to update project item templates that you've already created.
Read more >Edit templates
To update your template, open the file, make the changes you want, and then save the template. Click File > Open. Double-click This...
Read more >What is an Update Template?
An Update Template enables you to insert Windows batch file commands directly into the installation script. The commands can be executed before or...
Read more >How to Upgrade .NET CLI Templates
Checks if there are updates available for the template packs that are currently installed and installs them. Available since .NET Core 3.0 SDK....
Read more >Update Dotnet Core Projects with new ...
If there is a way to update existing projects created using dotnet new with a custom template with updates made to the template....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Scenario: We have an internal template published at version 0.3.0. A fix is made, version 0.3.1 gets published.
When 0.3.0 is published, it gets installed with
dotnet new -i TemplatePackage --nuget-source https://our.internal.nuget.server
.Now 0.3.1 is published. Running
dotnet new --update-check
does not find version 0.3.1. Runningdotnet new --update-check --nuget-source https://our.internal.nuget.server
also does not find version 0.3.1. Trying to install using the above-i
command does not find the new version.To upgrade, you have to flush the NuGet cache and then manually install again, which will pick up the new version and update.
It seems like
--update-check
isn’t doing what it says on the tin; and if you use-i
it should logically check the package source first, rather than the cache.If I try to update by doing
dotnet new -i <package name>
it does not replace with the newest versionIf I try to update by doing `dotnet new -i <package name>::<version> then i get a message saying that it could not find that versions
If I try to update by doing `dotnet new -i <package name>::<version> --nuget-source <source> then I still get a message saying that it could not find that version
If list with
nuget list <package> -s <source>
then it shows the latest package, so I know it’s there and indexed/availableIf uninstall the package, clear the local nuget cache, and then install
dotnet new -i <package name>
then it installs the correct version.