断点不会在VSCode中命中

时间:2018-11-15 05:48:42

标签: c# asp.net-web-api visual-studio-code .net-core vscode-debugger

我是VSCode的新手,正在使用VSCode,.Net Core和Angular CLI进行示例项目。 在后端使用SqlLite和EntityFramework创建了一个基本的User类和Registration类。 当我运行该应用程序时,在附加.Net Core Attach进程或从Web Launch进行连接时,我无法遇到任何断点。 尝试从邮递员发布数据时,响应为:应用程序已完成,而没有读取整个请求正文 我的工作目录是C:\ Users \ xxxx \ Documents \ Dateapp \ DateApp.API> 以下是launch.json

{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/DateApp.API/bin/Debug/netcoreapp2.1/DateApp.API.dll",
"args": [],
"cwd": "${workspaceFolder}/DateApp.API",

        "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": "${workspaceFolder}/Views"
        }
    },
    {
        "name": ".NET Core Attach",
        "type": "coreclr",
        "request": "attach",
        "processId": "${command:pickProcess}",


    }
,]
}

我的CSProj文件如下所示

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeFrameworkVersion>2.1</RuntimeFrameworkVersion>
  </PropertyGroup>
  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.0" />
  </ItemGroup>
</Project>

0 个答案:

没有答案