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.

Update an already installed template

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Comments:28 (11 by maintainers)

github_iconTop GitHub Comments

7reactions
tilligcommented, Oct 3, 2019

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. Running dotnet 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.

dotnet nuget locals all --clear
dotnet new -i TemplatePackage --nuget-source https://our.internal.nuget.server

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.

5reactions
jstafford5380commented, Apr 11, 2020

If I try to update by doing dotnet new -i <package name> it does not replace with the newest version

If 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/available

If uninstall the package, clear the local nuget cache, and then install dotnet new -i <package name> then it installs the correct version.

Read more comments on GitHub >

github_iconTop 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 >

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