小编Ayt*_*rld的帖子

如何在linux(ubuntu)中使用vscode调试asp.net core 3.1

我按照默认步骤操作

  • 安装.NET Core,( linux-package-manager-ubuntu-1604 )
  • 在 VSCode 中创建并打开(ASP.NET core 空)项目,( cd ~/projects && dotnet new web -o my-api && cd my-api && code .)
  • 添加 vscodetasks.json 和 launch.json(C# 扩展),(ms-dotnettools.csharp
  • 添加断点(在 VSCode 中),
  • 并开始调试(在 VSCode 中按 F5)。

但这不会启动网络服务器,也不会在断点处停止...它确实构建了项目,因为我可以看到 bin/Debug/netcoreapp3.1/ 中生成的文件

在项目根目录中运行dotnet run,构建(恢复)并运行网络服务器,我可以浏览到https://localhost:5001http://localhost:5000。但无法调试...

这是创建的vscode文件

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 …
Run Code Online (Sandbox Code Playgroud)

c# visual-studio-code ubuntu-16.04 vscode-debugger asp.net-core-3.1

5
推荐指数
1
解决办法
5553
查看次数