【问题标题】:Launching and debugging Blazor server and webasm on VS Code在 VS Code 上启动和调试 Blazor 服务器和 webasm
【发布时间】:2021-11-03 14:15:43
【问题描述】:

我曾尝试运行 Visual Studio 代码,以构建、启动和调试(使用omnisharp 和 dotnet...)blazor 服务器和 webasm 项目,但似乎一次只启动一个项目,即使 task.json 两者都有的项目?有没有办法同时启动两个项目?还是让一个执行,而另一个启动,以防万一这是不可能的?

这是我的 launch.json


{
    "version": "0.2.0",
    "configurations": 
    [
        {
            // 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
            "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}/BlazorApp/bin/Debug/net5.0/BlazorApp.dll",
            "args": [],
            "cwd": "${workspaceFolder}/BlazorApp",
            "stopAtEntry": false,
            // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development",
                "ASPNETCORE_URLS": "http://localhost:5010"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach"
        }, 
       
        {
            "type": "blazorwasm",
            "name": "Launch and Debug Blazor WebAssembly Application",
            "request": "launch"
        }
    ]
}

【问题讨论】:

标签: visual-studio-code blazor blazor-server-side blazor-webassembly asp.net-blazor


【解决方案1】:

答案是在 launch.json 中使用复合参数

How to run multiple tasks in VS Code on build?

至于调试,我还没有看到如何让 js 调试器在 Chrome 上工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-30
    • 2018-09-09
    • 2019-06-06
    相关资源
    最近更新 更多