最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

visual studio 2022 - Breakpoint Problem on Blazor WASM hosted project - Stack Overflow

programmeradmin0浏览0评论

I am trying to debug my Blazor WASM hosted project, but I get the following error when I run the project:

I don't understand why.

All breakpoints in the server project hit just fine. One thing I noted when I go to Debug->Windows->Modules, I can see the Server project listed there, but I don't see the Client project in the list. Why would that be?

I have gone through many project settings as well, but I cannot figure out what's wrong.

I am using Visual Studio 2022 latest version and application is on .NET9, Blazor WASM, hosted application with Server, Client and Shared projects.

launchSettings.json in the Server project:

{
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
    },
    "IMS5_1.Server": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "dotnetRunMessages": "true"
    },
    "WSL": {
      "commandName": "WSL2",
      "launchBrowser": true,
      "launchUrl": "https://localhost:5001",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000"
      },
      "distributionName": "Ubuntu",
      "dotnetRunMessages": "true"
    }
  },
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": false,
    "iisExpress": {
      "applicationUrl": "http://localhost:31647",
      "sslPort": 44346
    }
  }
}

launchSettings.json in the Client project:

{
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "nativeDebugging": true
    },
    "WSL": {
      "commandName": "WSL2",
      "distributionName": ""
    }
  },
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:61992/",
      "sslPort": 44382
    }
  }
}

Any ideas? This is just driving me crazy...

I am trying to debug my Blazor WASM hosted project, but I get the following error when I run the project:

I don't understand why.

All breakpoints in the server project hit just fine. One thing I noted when I go to Debug->Windows->Modules, I can see the Server project listed there, but I don't see the Client project in the list. Why would that be?

I have gone through many project settings as well, but I cannot figure out what's wrong.

I am using Visual Studio 2022 latest version and application is on .NET9, Blazor WASM, hosted application with Server, Client and Shared projects.

launchSettings.json in the Server project:

{
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
    },
    "IMS5_1.Server": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "dotnetRunMessages": "true"
    },
    "WSL": {
      "commandName": "WSL2",
      "launchBrowser": true,
      "launchUrl": "https://localhost:5001",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000"
      },
      "distributionName": "Ubuntu",
      "dotnetRunMessages": "true"
    }
  },
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": false,
    "iisExpress": {
      "applicationUrl": "http://localhost:31647",
      "sslPort": 44346
    }
  }
}

launchSettings.json in the Client project:

{
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "nativeDebugging": true
    },
    "WSL": {
      "commandName": "WSL2",
      "distributionName": ""
    }
  },
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:61992/",
      "sslPort": 44382
    }
  }
}

Any ideas? This is just driving me crazy...

Share Improve this question asked Feb 2 at 12:41 user3656651user3656651 8223 gold badges17 silver badges28 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Hit and trial, I figured it out. The following 2 things:

  1. I had <DebuggerSupport>true</DebuggerSupport> in the client project file. I removed it.

  2. The wasm modules debugging still doesn't work on Firefox. But now it works on Edge and Chrome.

发布评论

评论列表(0)

  1. 暂无评论