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.

`dotnet new --uninstall` not working for folder templates

See original GitHub issue

[Migrating from dotnet/core#893 per tweets with @sayedihashimi]

Unable to uninstall folder-based templates

This could be an issue with the dotnet net --uninstall (or dotnet new -u) command, or just an issue with uninstall documentation, but it doesn’t seem possible to uninstall a template via a folder template.

See also this Stack Overflow question.

General

Steps

  1. Create template folder (.template.config folder with a template.json file)

    I have confirmed it with this JSON config.

    {
        "$schema": "http://json.schemastore.org/template",
        "author": "Some Author",
        "classifications": [ "Some", "Various", "Search Keywords" ],
        "identity": "Some.Identity",
        "shortName": "name-used-in-dotnetnew",
        "name": "Some Template Name"
    }
    
  2. Install template

    dotnet new --install ./some-template-folder/
    
  3. [optional] Use newly-installed template

    The template "Some Template Name" was created successfully.
    
  4. Attempt to uninstall template

    dotnet new --uninstall ./some-template-folder/
    

    Instead of uninstalling, I keep getting this error message.

    Could not find something to uninstall called '.\some-template-folder\'.

This happened with .NET Core SDK v1.1.0 and v2.0.0.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
seancpeterscommented, Aug 29, 2017

@patridge - I believe you have discovered a bug. Could you try uninstalling one more time, using the full path, but without a trailing slash: dotnet new --uninstall "C:\full\path\to\some-template-folder"

Could you also let me know the output from running dotnet --version?

0reactions
patridgecommented, Sep 4, 2017

I filed a PR for clarifying this in the docs here: dotnet/docs#3054, regardless of any internal changes required.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to uninstall `dotnet new` via folder template?
This successfully puts the template in place for use with dotnet new {shortName} . The template "Some Template Name" was created successfully.
Read more >
dotnet new uninstall - .NET CLI
The dotnet new uninstall command uninstalls a template package.
Read more >
Custom templates for dotnet new - .NET CLI
Use the dotnet new uninstall command to uninstall a template package. If the package was installed by either a NuGet feed or by...
Read more >
Install and manage SDK templates - .NET
Uninstall template package. Template packages are uninstalled through the dotnet new uninstall SDK command. You can either provide the NuGet ...
Read more >
Create an item template for dotnet new - .NET CLI
Uninstall the template​​ In your terminal, navigate to the extensions folder and run the following command to uninstall the templates located at ...
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