How to run a .net core app globally
See original GitHub issueMy system path
env varaible is too large, otherwise I’d put it there.
How to do that, wihtout cd
-ing to the deployment folder?
I tried:
dotnet tool install -g myConsoleTool --add-source=./nupkg
cmd.exe: myConsoleTool
Unhandled exception. System.IO.FileNotFoundException: The configuration file ‘appsettings.json’ was not found and is not optional. The physical path is ‘C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\appsettings.json’.
The appsettings.json
file is in the bin
folder.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: b80f18fa-e6d2-50f6-dc08-a2ab5ba9f89a
- Version Independent ID: 5bebc66b-956a-47c7-7472-07967256be0c
- Content: Create a .NET Core console application using Visual Studio - .NET Core
- Content Source: docs/core/tutorials/with-visual-studio.md
- Product: dotnet-core
- GitHub Login: @tdykstra
- Microsoft Alias: tdykstra
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
NET tools - .NET CLI
Install a global tool ... You can invoke the tool using the following command: dotnetsay Tool 'dotnetsay' (version '2.1.4') was successfully ...
Read more >Tutorial: Install and use a .NET global tool - .NET CLI
Install the tool from the package by running the dotnet tool install command in the microsoft.botsay project folder: .NET CLI Copy · Invoke...
Read more >Creating a .NET Global Tool from an existing Console ...
NET Core applications to make it execute with a simple command name, much like you would with an executable that's registered in the...
Read more >How to create a global variable in ASP.NET Core Web API ...
How to create a global variable in ASP.NET Core Web API application? · You can use a static class with static property. You...
Read more >.Net Core Global Tools: A fresh start for distributing ...
To make your console applications compatible, you need to add the entry <IsTool>true</IsTool> in your .csproj. It is also important that you target...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Directory.GetCurrentDirectory()
will give you thecurrent working directly
. It is related to your shell. You can start fromSystem.Reflection.Assembly.GetAssembly(typeof(THETYPE)).Location;
Ok, I was confused, because I couldn’t see any dependent files next to the
gitrepo.exe
. Thanks for your support!var location = Path.GetDirectoryName(Assembly.GetAssembly(typeof(Program)).Location);