4

我正在尝试在 VS Code 中调试 Web 应用程序。我使用 dotnet new angular 创建了以下应用程序。我将此应用程序添加到解决方案中。应用程序构建并运行得很好。我可以通过附加到它来调试应用程序。但是当我尝试在调试模式下运行应用程序时,出现以下异常:

抛出异常:System.Private.CoreLib.ni.dll 中的“System.AggregateException”

作为健全性检查,我在解决方案中添加了一个控制台应用程序并尝试对其进行调试。调试控制台应用程序工作得很好。所以然后我尝试像这样创建一个 dotnet core mvc:

dotnet new mvc -n try-me -o try-me

我添加了一个启动配置,它调试得很好。所以这看起来可能只是角度模板的问题。有没有其他人得到这个模板来调试?这是我的launch.json。“.NET Core Launch (web)”的配置是有问题的。

{
"version": "0.2.0",
"configurations": [   

    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/jollies/bin/Debug/netcoreapp1.1/jollies.dll",
        "args": [],
        "cwd": "${workspaceRoot}",
        "stopAtEntry": false,
        "console": "internalConsole"
    },
    {
        "name": ".NET Core Launch (web)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/cars-webapp/bin/Debug/netcoreapp1.1/cars-webapp.dll",
        "args": [],
        "cwd": "${workspaceRoot}/cars-webapp",
        "stopAtEntry": false,
        "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 Launch (web-try me)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/try-me/bin/Debug/netcoreapp1.1/try-me.dll",
        "args": [],
        "cwd": "${workspaceRoot}/try-me",
        "stopAtEntry": false,
        "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}"
    }
]

}

4

0 回答 0