dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.36k stars 9.99k forks source link

Debugging & Hot Reload is Broken When App's Base Path is Changed #46809

Open daytonjallen opened 1 year ago

daytonjallen commented 1 year ago

Is there an existing issue for this?

Describe the bug

Debugging and hot reload is broken when app base path is changed in index.html and launchsettings.json.

Expected Behavior

Debugging and hot reload with a different base path should work

Steps To Reproduce

Repo reproducing problem here: https://github.com/daytonjallen/HotReloadPathIssueRepro

  1. Start new blazor wasm project
  2. Update base path in index.html
  3. Update paths in launchsettings.json (problem exists when using both the IIS & http run configs)
  4. Try to debug project

App will fail to load due to exceptions from not finding blazor-hotreload.js etc:

image

Exceptions (if any)

blazor.webassembly.js:1

   System.AggregateException: One or more errors occurred. (Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js

TypeError: Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js) ---> Microsoft.JSInterop.JSException: Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js TypeError: Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js at Microsoft.JSInterop.JSRuntime.d__16`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() at Microsoft.AspNetCore.Components.WebAssembly.HotReload.WebAssemblyHotReload.InitializeAsync() at Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHost.RunAsyncCore(CancellationToken cancellationToken, WebAssemblyCultureProvider cultureProvider) at Program.

$(String[] args) in C:\Users\dallen\source\repos\HotReloadPathIssueRepro\HotReloadPathIssueRepro\Program.cs:line 11 --- End of inner exception stack trace ---

.NET Version

7.0.200

Anything else?

Visual Studio Version: 17.5.0

image

ghost commented 1 year ago

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

damien-c-d commented 1 year ago

I am also experiencing this issue.

Visual Studio Enterprise 17.6.3

.NET SDK: Version: 7.0.304 Commit: 7e794e2806

Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.304\

Host: Version: 7.0.7 Architecture: x64 Commit: 5b20af47d9

ghost commented 1 year ago

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.