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.

Is there a way to package a binary as a global tool

See original GitHub issue

Steps to reproduce

I have native binaries (one for each platform) that I want to package as global CLI tools to make it available in my dotnet projects. I would prefer to not rewrite it in C#. I know that there are non .net projects in nuget like https://github.com/edenhill/librdkafka but can’t find any info/example of a native dotnet tool. Is this possible?

I also raised this question in SO

Expected behavior

Packaging a set of native binaries with metadata (entry point, supported platforms) in a .nupkg will be installable with dotnet tool install -g. It would choose the appropriate binaries based on the platform and ~/.dotnet/tools.

Actual behavior

Can’t find a way to do this in the documentation.

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   2.1.300
 Commit:    adab45bf0c

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.3.9600
 OS Platform: Windows
 RID:         win81-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.300\

Host (useful for support):
  Version: 2.1.0
  Commit:  caa7b7e2ba

.NET Core SDKs installed:
  1.0.0-preview4-004233 [C:\Program Files\dotnet\sdk]
  1.0.4 [C:\Program Files\dotnet\sdk]
  2.0.3 [C:\Program Files\dotnet\sdk]
  2.1.2 [C:\Program Files\dotnet\sdk]
  2.1.201 [C:\Program Files\dotnet\sdk]
  2.1.300 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wli3commented, Aug 19, 2021

it would be more of a product discussion. Tool’s benefit today is the producer would only need to consider their .NET project since we can make the assumption of .NET SDK and runtime being available on the both side(transfer IL). However, there are many solutions today available to distribute binary like Windows store and homebrew. And also because of the inherent complexity of delivery machine specific binary, I don’t think .NET SDK will bring much to the table.

0reactions
zkatcommented, Aug 11, 2021

what would it take to make this possible?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I package a native binary as a global dotnet tool
Under the tools folder is a folder called dotnetcoreapp2.1. ... So under our current model, IF binary is supported, it should be any....
Read more >
Tutorial: Install and use a .NET global tool - .NET CLI
This tutorial teaches you how to install and use a global tool. ... Install the tool from the package by running the dotnet...
Read more >
NET tools - .NET CLI
Covers global tools, tool-path tools, and local tools. ... The tool binaries are installed in a default directory that's added to the PATH ......
Read more >
Packaging and distributing a Rust tool - Command Line ...
Another way is to use pre-built (Docker) images that contain all the tools we need to build binaries. This allows us to easily...
Read more >
What is Binary package? How to build them?
I run some direct package which is in "xyz.linux.run" format What are these package? Are they independent of dependencies? or Is it pre-built...
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