Can not use or detect global .net tools on Linux - asp.net

I have installed the dotnet-ef and a number of other packages but for some reason, I can't use them.
I added $HOME/.dotnet/tools as shown here:
https://learn.microsoft.com/en-us/dotnet/core/tools/troubleshoot-usage-issues
but running dotnet tool list still shows no packages.

Please note that dotnet tool list command checks for local tools by default. Try dotnet tools list -g to look for globally installed tools. Make sure your PATH contains the global tools folder location before running the installed tool. You can check your PATH by running echo $PATH. You can also check globally installed tools by running dotnet tool list --tool-path $HOME/.dotnet/tools. Following steps work for me:
dotnet tool install --global dotnet-ef
export PATH="$PATH:$HOME/.dotnet/tools"
dotnet tool list -g
dotnet-ef
HTH

Related

I installed a tool for dotnet CLI, why command tool list did not show it?

Look at the screenshot so you can better understand my question.
Why dotnetsay tool was not listed?
Why is dotnetsay tool not listed?
Please note that dotnet tool list command does help list all local tools available in the current directory, if you installed dotnetsay as a global tool, you can use following command to list all global tools.
dotnet tool list -g
Test Result
For more information about dotnet tool list command, please check:
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-list#examples
The answer for your question, to show your installed tool, use one of these ways:
dotnet tool list -g
dotnet tool list --global
dotnet tool list --tool-path C:\Users\samue
Practices these commands
Case install global:
dotnet tool uninstall dotnetsay --global
dotnet tool list
dotnet tool install dotnetsay --global
dotnet tool list --global
dotnetsay
Case install local:
mkdir C:\foo
dotnet tool uninstall dotnetsay --tool-path C:\foo
dotnet tool list --tool-path C:\foo
dotnet tool install dotnetsay --tool-path c:\foo
dotnet tool list --tool-path C:\foo
cd /d C:\foo
dotnetsay
Reference:
dotnet tool install https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install
dotnet tool list https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-list

NuGet install tools package in Docker Apline

I am trying to install a NuGet tools package inside an Alpine Docker container.
In Windows I would do the following -
nuget install SomeToolPackage
Doing so would result in a new set of directories like -
tools\netcoreapp2.1\SomeTool.dll
tools\netcoreapp2.1\* many other files
Question
What is the equivalent in for Linux. I am aware that some people are using Mono to run the Windows nuget.exe file.
I can also use wget and unzip.
I hope there is a better way using the tools from Microsoft.
The path going forward is to use dotnet tools (see also dotnet core global tools overview and creating a global tool). However, it's not a 1:1 mapping with nuget.exe install, as the package must be authored as a tool, whereas nuget install allows you to "install" any package.

How to use dotnet tool during Travis-CI build?

I'm trying to use dotnet-warp as a global tool in my .NET Core Travis-CI build, because I like the idea of a single executable so much better than a folder full of 75ish files.
I can successfully add the tool and verify there's a tools/dotnet folder in the $PATH...
But the log indicates that because .NET Core has been added recently, I'll need to restart or logout before I can actually use the tool.
Is anyone aware of a way to make this work in the Travis-CI environment?
Ran into the same issue, using the info from the Travis CI Installing Dependencies page and this comment on an issue about it, adding the following following to to my .travis.yml solved the problem:
before_script:
- export PATH=$PATH:/home/travis/.dotnet/tools
My build log:
$ export PATH=$PATH:/home/travis/.dotnet/tools
$ dotnet tool install -g dotnet-warp
You can invoke the tool using the following command: dotnet-warp
Tool 'dotnet-warp' (version '1.0.9') was successfully installed.
The command "dotnet tool install -g dotnet-warp" exited with 0.
$ cd ./src/[my project]/
The command "cd ./src/[my project]/" exited with 0.
$ dotnet-warp
Running Publish...
Running Pack...
Saved binary to "[my project]"
The command "dotnet-warp" exited with 0.

DotNet CLI Tool fails with "No executable found matching command "dotnet-migrate-2017"

I am trying to use migrate-2017 to migrate some csproj files to the new more concise vs2017 project format. I installed the tool from https://github.com/hvanbakel/CsprojToVs2017 using the command:
dotnet tool install --global Project2015To2017.Migrate2017.Tool
When I try to use it I get this:
C:\projects\Trilogy\Main>dotnet migrate-2017 wizard
No executable found matching command "dotnet-migrate-2017"
However, it appears to exist....
C:\projects\Trilogy\Main>dotnet tool list -g
Package Id Version Commands
------------------------------------------------------------------------
project2015to2017.migrate2017.tool 4.0.0 dotnet-migrate-2017
The global.json looks fine....
C:\projects\Trilogy\Main>type global.json
{
"sdk": {
"version": "2.1.602"
}
}
And so does the version:
C:\projects\Trilogy\Main>dotnet --version
2.1.602
I'm using dotnet CLI tools for the first time, so what obvious thing am I missing?
I don't think you're missing anything, but here's a few things to try:
Does running dotnet-migrate-2017 work (no dotnet required first)?
Does the tool exist under %userprofile%\.dotnet\tools?
Have you tried restarting the command prompt to force refresh your %PATH%?
Have you tried uninstalling and reinstalling the package?

Building SQLITE for the Nodewebkit (Using express.js)

I am having problems compiling SQLite for use with Nodewebkit. After research, it seems that I am having wrong versions of the programs. So I have:
- Node
- NW
- SQLite
Apparently there must be certain version of each of the mentioned programs to make it work.
What versions of the programs I must have, so I can run this command:
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=0.12.3
This link suggests I should have NW version 0.8.x. But I cant find it for download. Or maybe that is not the problem at all...
I build on Mac using node-webkit v0.12.3 using the following commands:
sudo npm install nw-gyp -g
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=0.12.3
First, make sure you installed nw-gyp globally. Then, run the command either in the directory containing node-webkit executables (nwjs), or in a subfolder of that folder.
Running the command should then create a node_modules folder in the same directory as the binaries, containing the sqlite3 module.

Resources