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.

How to run a .net core app globally

See original GitHub issue

My 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.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
wli3commented, Jun 29, 2020

Directory.GetCurrentDirectory() will give you the current working directly. It is related to your shell. You can start from System.Reflection.Assembly.GetAssembly(typeof(THETYPE)).Location;

0reactions
Legendscommented, Jun 29, 2020

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);

Read more comments on GitHub >

github_iconTop 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 >

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