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.

When installing a .NET local tool, create the tool manifest if one does not exist

See original GitHub issue

When a user tries to install a .NET tool as a local tool on a folder that does not contain the manifest, we get an error Cannot find a manifest file.

> dotnet tool install --local Cake.Tool --version 0.38.4
Cannot find a manifest file.
For a list of locations searched, specify the "-d" option before the tool name.
If you intended to install a global tool, add `--global` to the command.
If you would like to create a manifest, use `dotnet new tool-manifest`, usually in the repo root directory.

However, if the user tries to update an existing local tool, dotnet tool is able to update the existing manifest:

dotnet new tool-manifest
dotnet tool install --local Cake.Tool --version 0.38.4
dotnet tool update --local Cake.Tool
Tool 'cake.tool' was successfully updated from version '0.38.4' to version '0.38.5' (manifest file /Users/augustoproiete/.config/dotnet-tools.json).

TL;DR; It would be great if dotnet tool install automatically created the tool manifest, if one does not exist when installing a local tool, instead of failing with an error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
timheuercommented, Mar 31, 2021

Finding an analog, NPM does this by default as well with package.json and puts it in the right place. Users who do npm install moment for example, get a non-global package and a package.json dropped in the right place. We should have the similar and easy experience reducing the ceremony for such things.

2reactions
augustoproietecommented, Jan 23, 2021

The side of doing that is we could potentially generating manifest file accidentally on unexpected locations. And people could run unexpected tool.

Add a --force or --trust-me parameter so users can convince dotnet tool that they know what they are doing? 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial: Install and use .NET local tools - .NET CLI
This tutorial teaches you how to install and use a local tool. You use a tool that you create in the first tutorial...
Read more >
dotnet tool install command - .NET CLI
To install a global tool in a custom location, use the --tool-path option. To install a local tool, omit the --global and --tool-path...
Read more >
.NET Tools - Cannot find a manifest file
To install a tool for local access only, it has to be added to a tool manifest file. As I didn't create such...
Read more >
Fixing error in .NET Core tool installation
Last week I was testing some .NET tooling and wanted to install a tool locally instead of globally. To do so you run...
Read more >
Why does my dotnet tool run when installed locally, but not ...
I've written a dotnet tool following the documentation, targeting .NET 6. I can install and run it as a local tool. It works...
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