0

I have a really annoying problem with dotnet watch and blazor/wasm. I have a solution in which I have multplie projects, for example an API, a blazor/wasm project and some common classlibraries. I start the API part with CTRL+F5, and I start the Blazor part from the Windows terminal with dotnet watch (because I want to use hot reload). Now the project starts up fine and everything works. But when I change something in one of the blazor files, the blazor app displays LOTS of errors about not being able to find stuff, both in the browser window as in the dotnet watch terminal. This even happens when I do not make any change but simply do Ctrl+S in Visual Studio. If I then close the Blazor app, and restart the dotnet watch command, everything builds fine, until some file's modification date is updated.

If I git clone the project on another location on the same PC, everything works fine, until a (few) day(s) later. If I completely delete the original project location on the PC and re-clone the project, the problem persists. As if it remembers the project location. Now I can only fix this temporarily by changing the project working directory location every other day...

What on earth can this be?

(Edit: I've seen this mentioned some 14 months ago, about a bug in the SDK: https://github.com/dotnet/aspnetcore/issues/28541 No solution there however.

TendenZ
  • 1
  • 1
  • What kind of errors are you seeing? Sometimes I encounter weird errors too whenever I update Razor pages on Visual Studio but I just give it some time for the changes to be applied, especially when I'm using hot reload – Raffy Mar 02 '22 at 23:55
  • like these, but hundreds of them: https://ibb.co/TP19qGM . When I close the page, and re-run dotnet watch, the're gone and everything works. when adding a space or just pressing CTRL+S on a random page in the wasm project, it happens again. – TendenZ Mar 09 '22 at 10:02

0 Answers0