How to use the dotnetcore2.runtime._get_bin_folder function in dotnetcore2

To help you get started, we’ve selected a few dotnetcore2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / NimbusML / src / python / nimbusml / internal / utils / utils.py View on Github external
def get_clr_path():
    """
    Return path to .NET CLR binaries.
    Use dotnetcore2 package if Python 3.x, otherwise look for libs bundled with
    NimbusML.
    """
    if six.PY2:
        return get_mlnet_path()
    else:
        from dotnetcore2 import runtime as clr_runtime
        libs_root = os.path.join(clr_runtime._get_bin_folder(), 'shared', 
                                'Microsoft.NETCore.App')

        # Search all libs folders to find which one contains the .NET CLR libs
        libs_folders = os.listdir(libs_root)
        if len(libs_folders) == 0:
            raise ImportError("Trouble importing dotnetcore2: "
                                "{} had no libs folders.".format(libs_root))
        clr_path = None
        for folder in libs_folders:
            if os.path.exists(os.path.join(libs_root, folder, 
                                           'Microsoft.CSharp.dll')):
                clr_path = os.path.join(libs_root, folder)
                break
        if not clr_path:
            raise ImportError(
                "Trouble importing dotnetcore2: Microsoft.CSharp.dll was not "

dotnetcore2

.Net Core 3.1 runtime

MIT
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis

Similar packages