[英]Unable to hit breakpoints in Blazor WASM
我正在嘗試調試 Blazor WebAssembly 應用程序,但在嘗試設置斷點時收到以下消息:
如果我執行會達到斷點的操作,Visual Studio 會打開一個新選項卡,顯示Unable to retrieve source content (Unable to retrieve source content)
。 我在單獨的 blazor 服務器應用程序以及首次創建 blazor 項目(counter.razor 和 fetchdata.razor)時提供的示例模板中遇到了同樣的問題。
Here is the info on the app: Target Framework: .NET 5.0 (Current) Authentication Type: None Configure for HTTPS: True ASP.NET Core hosted: False Progressive Web Application: True
我正在使用 Visual Studio 2019 版本 16.9.4。
我的.csproj 文件是:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.5" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
</Project>
我的launchSettings.json 文件是:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:59417",
"sslPort": 44389
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Test": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
我已經嘗試過這里和這里給出的解決方案。 我還檢查了https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-3-release-now-available/ ,即使它已經有一年了。 我多次重新啟動 Visual Studio,刪除了 .vs 文件,重新啟動了我的 comp,但同樣的問題。
錯誤的原因是我的解決方案路徑的文件夾名稱中有一個“#”。討論了這個錯誤https://github.com/dotnet/aspnetcore/issues/22036 ,如果您關注該線程,顯然永遠無法解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.