visual-studio-code - 如何在 Windows 上使用 Visual Studio Code 设置 Kestrel 调试?

标签 visual-studio-code kestrel-http-server

我很难找到有关如何使用 launch.json 文件在 Windows 上的 Visual Studio Code 中设置调试的说明(如果重要,则为 10)。

有人可以定义如何设置吗?

最佳答案

要使用 Visual Studio 代码进行调试,您必须确保您在调试选项卡中选择的配置在 launch.json 中正确设置。
launch.json 中的配置应该是这样的

"configurations": [
    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/Example.dll",
        "args": [],
        "cwd": "${workspaceRoot}/",
        "stopAtEntry": false
    }]

根据我的经验,最常见的问题是程序 dll 的路径不正确。我会仔细检查此路径是否实际指向您编译的调试 dll。如果没有,请修改此路径或修改调试 url 的目标位置(第一个更容易)。如果您有任何问题,请发表评论,我刚刚自己解决了这个问题。

关于visual-studio-code - 如何在 Windows 上使用 Visual Studio Code 设置 Kestrel 调试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34097303/

相关文章:

c# - 在自托管 ASP.NET Core 微服务中启动多个后台线程

ssl - 如何在 ASP.NET Core 2.x 中将 HTTPS/SSL 与 Kestrel 一起使用?

使用 vscode ctrl+f2 的 macos 无法按预期在 macos 上运行

visual-studio-code - 如何在 Windows 上从 cli 卸载 VS Code

visual-studio-code - 如何在Visual Studio代码中为C++设置默认代码?

multithreading - 如何在 Linux (Kubernetes) 上解决 ASP.NET Core 中的线程不足问题?

asp.net-core - 无法使用超过 260 个字符的字符串作为 .NET Core 中的 URL 段

docker - 是否有人使用 ubuntu 18.04 在 docker 中使用 gRPC 服务器在微服务中部署了 .NET Core

visual-studio-code - 如何在 vscode 中设置 tslint.json 文件位置?

c++ - Visual Studio Code - 未找到 SFML 库