BlazorStatic: dotnet watch with .NET 9 fails to update markdown
I was trying to run with .NET 9, and it seems dotnet watch isn’t calling MetadataUpdateHandler for content files changes. After updating a markdown file, I’ll see the messages that a change has been detected, but the call to MetadataUpdateHandler doesn’t occur. There might also be a race condition introduces for updating razor files too that I want to track down, sometimes when editing those I’ll get an exception about collections being updated while enumerating them in BlazorStaticService, a different collection each time. I suspect multiple calls are coming in at once.
I found this issue in aspnetcore regarding resx files not being updated with a similar pattern, so it might be the issue to track with ASP.NET - https://github.com/dotnet/aspnetcore/issues/60835
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 18 (1 by maintainers)
yeah, some things got away from me solving the concurrency issues with multiple changes at once. One of the reasons for the move to the synchronous code was because I was lazy loading in the
Postsproperty, so I’d just be wrapping up the async code in a Task awaiter to run code that isn’t gonna be used in a scenario where we are in a wait state anyways. But I suspect if I drop everything and try and revert back to a file system watcher that just copies into the output folder going back to the old way that wouldn’t be needed. Concurrency problems would still be there, but I believe it fails in such a way that it still works just with some exceptions in the dotnet watch output.When I said brittle that was probably a poor choice in words. It was just unexpected. User would have to know that they need to be doing read/writes to the content out of that folder and pull it by hand, and then I don’t believe it is consistent as things like wwwroot or media are served from those folders. Nothing that can’t be figured out. Let me think about how to best get the file system watcher moving those files into the bin folder and tackle the rest another day.