在OSX上使用Visual Studio代码进行调试不使用手动路径

chr*_*ris 8 macos omnisharp visual-studio-code asp.net-core

我正在尝试在OSX上调试一个dotnet核心项目并继续得到一个它无法找到所需库的引用错误.

A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/Chris/Google Drive/Repos/project/src/project.api/bin/Debug/netcoreapp1.0'.
WARNING: The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use Microsoft.NETCore.App 1.0.0 or newer. This may be expected if the target process did not run .NET code.
The program '/Users/Chris/Google Drive/Repos/project/project.api/src/project.api/bin/Debug/netcoreapp1.0/project.api.dll' has exited with code 131 (0x00000083).
Run Code Online (Sandbox Code Playgroud)

所以我查看了bin目录,注意到netcoreapp1.0下有一个名为osx.10.11-x64的附加目录.

在此输入图像描述

在我的launch.json中如果我手动添加到程序路径一切正常 - 我只是想知道这是否正常,如果运行时可以动态拾取,所以我不必更改我工作的不同机器的程序路径(windows,nix,osx)

这是launch.json的副本

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (web)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceRoot}/src/project.api/bin/Debug/netcoreapp1.0/osx.10.11-x64/project.api.dll",
            "args": [],
            "cwd": "${workspaceRoot}",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart",
            "launchBrowser": {
                "enabled": true,
                "args": "${auto-detect-url}",
                "windows": {
                    "command": "cmd.exe",
                    "args": "/C start ${auto-detect-url}"
                },
                "osx": {
                    "command": "open"
                },
                "linux": {
                    "command": "xdg-open"
                }
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceRoot}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command.pickProcess}"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)