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.

Question on dotnet uninstall

See original GitHub issue

I think I have a misunderstanding on how -u|-uninstall works (or perhaps there’s a list refresh that I’m missing for an uninstalled template).

For testing purposes I created a few file system test templates, such as this one for Giraffe4.Template/giraffe4

{
  "identity": "Giraffe4.Template",
  "author": "guardrex",
  "classifications": [ "Web", "Giraffe", "blah" ],
  "name": "Giraffe Web App4",
  "tags": {
    "language": "F#"
  },
  "shortName": "giraffe4",
  "sourceName": "_AppName"
}

Install works fine …

dotnet new -i c:\template4

However, uninstall doesn’t want to remove the template. I’ve tried the following two commands …

dotnet new -u Giraffe4.Template
dotnet new -u giraffe4

… but the template persists in the list …

capture

dotnet --info:

.NET Command Line Tools (2.0.0-preview2-006349)

Product Information:
 Version:            2.0.0-preview2-006349
 Commit SHA-1 hash:  30a0bc3028

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0-preview2-006349\

Microsoft .NET Core Shared Framework Host
  Version  : 2.0.0-preview2-25406-03
  Build    : baa69770c40ce13dcb1a8979b288be8cb23f9c7b

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

4reactions
guardrexcommented, Jun 19, 2017

@seancpeters I had to delete my last message, because I was still in the process of wrapping my brain around it: It turns out that one installs from a nupkg on disk (locally) (never from a nuspec) but then uninstalls by just providing the package name as you said earlier.

So if the user installs with …

dotnet new -i C:\Users\<USER>\GarciaSoftware.ConsoleTemplate.CSharp.1.0.0.nupkg

they uninstall with …

dotnet new -u GarciaSoftware.ConsoleTemplate.CSharp.1.0.0

Going back to an earlier post, I think it would be far simpler if uninstall was merely based on giving the shortName to the command …

dotnet new -u garciaconsole

… and let the ✨ .NET magic ✨ figure out where/what to uninstall, even if it only meant delisting the template (i.e., when the template itself is no longer on disk or a template at nuget.org doesn’t exist/can’t be found).

I think that I have what I need to get the 1st draft of this topic out, which relies heavily on the Wiki and @sayedihashimi’s blog post to cover the deeper/finer points. Is it ok if I ping you on the PR to take a 👀 look at it?

3reactions
seancpeterscommented, Jun 16, 2017

Hi @GuardRex, Uninstall is currently driven by the location the template was installed from. Since giraffe4 was installed using: dotnet new -i c:\template4 you’ll be able to uninstall it using the same path: dotnet new -u c:\template4

Please let us know if that works for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do i uninstall 2021-12 .NET 6.0.1
How can we uninstall dotnet6 installed through "Windows Hosting Bundle Installer" from windows server(not on local) on PROD without ...
Read more >
dotnet-core-uninstall not working from command line
1 Answer. dotnet-core-uninstall is a separate experimental tool, not part of the . NET Core SDK. You need to download from its Github...
Read more >
How to uninstall dotnet from Ubuntu 20.10 completely?
Try with major and minor version only: sudo apt remove --purge dotnet-sdk-6.0 sudo apt remove --purge dotnet-runtime-6.0.
Read more >
What happens when I uninstall .Net Core 3.1?
What happens when I uninstall .Net Core 3.1? Looks like Ivanti also acknowledges that .Net Core 3.1 beeing out of support is no...
Read more >
Uninstall .NET Core SDK older versions
I've got many versions of .NET Core SDK installed in my Windows 10 PC. I'm wondering if older versions can be uninstalled:.
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