Giter Club home page Giter Club logo

woofware.dotnetruntimelocator's Introduction

WoofWare.DotnetRuntimeLocator

Helpers to locate the .NET runtime and SDKs programmatically. (If you're parsing dotnet --list-runtimes, you're doing it wrong!)

Usage

See the example.

let info = DotnetEnvironmentInfo.Get ()
// or, if you already know a path to the `dotnet` executable...
let info = DotnetEnvironmentInfo.GetSpecific "/path/to/dotnet"

Troubleshooting

The easiest way to make sure we can find a dotnet is to have one on your PATH.

If you have a very strange setup, we may be unable to locate the libhostfxr library we use to find the runtimes. In that case, you can supply the environment variable WOOFWARE_DOTNET_LOCATOR_LIBHOSTFXR, which should be a full path to a libhostfxr DLL on your system. (Normally this is in /usr/share/dotnet/host/fxr/{runtime}/libhostfxr.so; you must make sure your version is from runtime 6 or greater, because the required symbols were not added until then.)

woofware.dotnetruntimelocator's People

Contributors

smaug123 avatar patrick-conscriptus[bot] avatar dependabot[bot] avatar

Stargazers

Jimmy Byrd avatar

Watchers

 avatar

woofware.dotnetruntimelocator's Issues

How is `dotnet --list-runtimes` doing it when runtimes are symlinked into place?

Nix:

{
  devShell = pkgs.mkShell {
        packages = [
          (pkgs.dotnetCorePackages.combinePackages [pkgs.dotnetCorePackages.sdk_8_0 pkgs.dotnetCorePackages.runtime_6_0])
        ]
  }
}

The result is a directory structure /nix/blah-combined/host/fxr/ which contains symlinks to other FXRs, and /nix/blah-combined/shared/Microsoft.NETCore.App/ which likewise contains symlinks. When I run RuntimeEnvironment.GetRuntimeDirectory(), I get the runtime directory after following symlinks, not before, so as far as DotnetRuntimeLocator is concerned, there is only one runtime (namely the currently executing one).

How is dotnet --info doing it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.