Debugging dotnet angular template web application in Visual Studio Code

I am trying to debug a web application in VS code. I created the application after using dotnet new angular. I added this application to the solution. The application builds and works just fine. I can debug the application by joining it. But when I try to run the application in debug mode, I get the following exception:

Exception thrown: 'System.AggregateException' in System.Private.CoreLib.ni.dll

As a health check, I added a console application to the solution and tried to debug it. Debugging a console application works fine. So, I tried to create the dotnet mvc kernel as follows:

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

I added a launch configuration and it is fine debugging. So this seems like a problem with the angular pattern. Has anyone else got this debugging template? Here is my launch.json. The configuration for ".NET Core Launch (web)" is the one in question.

{
"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
source share

Source: https://habr.com/ru/post/1674426/


All Articles