在当前目录中找不到'project.json' - .NET Core Webapp调试

Rov*_*ret 9 asp.net-core-mvc visual-studio-code asp.net-core

我正在尝试使用.NET Core RC2和Visual Studio Code在OSX环境中设置调试.尝试运行调试程序时出现以下错误.

Couldn't find 'project.json' in current directory
Run Code Online (Sandbox Code Playgroud)

目前我已经设置了launch.json(见下文),并在Visual Studio Code中选择了.NET Core Launch(web).由于我的项目位于一个名为Core的文件夹中,并与另外两个文件夹共享空间,因此我的结构如下所示.

结构
- .vscode
------ launch.json
------ tasks.json

- 核心

- Core.Data

- Core.Service

launch.json

{
"version": "0.2.0",
"configurations": [
    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/Core/bin/Debug/netcoreapp1.0/Core.dll",
        "args": [],
        "cwd": "${workspaceRoot}/Core",
        "stopAtEntry": false
    },
    {
        "name": ".NET Core Launch (web)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/Core/bin/Debug/netcoreapp1.0/Core.dll",
        "args": [],
        "cwd": "${workspaceRoot}/Core",
        "stopAtEntry": false,
        "launchBrowser": {
            "enabled": true,
            "args": "${auto-detect-url}",
            "windows": {
                "command": "cmd.exe",
                "args": "/C start ${auto-detect-url}"
            },
            "osx": {
                "command": "open",
                "args": "-a chrome ${auto-detect-url}"
            },
            "linux": {
                "command": "xdg-open"
            }
        }
    },
    {
        "name": ".NET Core Attach",
        "type": "coreclr",
        "request": "attach",
        "processName": "<example>"
    }
]
}
Run Code Online (Sandbox Code Playgroud)

文件夹结构

在此输入图像描述

mef*_*ect 15

我需要添加此代码

tasks.json

 "options":{
    "cwd": "${workspaceRoot}/Core"
 }
Run Code Online (Sandbox Code Playgroud)

  • 这个答案出现在低质量审核队列中,大概是因为您没有提供任何代码说明.如果此代码回答了问题,请考虑在答案中添加一些解释代码的文本.通过这种方式,你更有可能得到更多的赞成 - 并帮助提问者学习新东西. (7认同)