-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlazorWebView on Windows Forms locks CSS files while the app is running #7479
Comments
@SteveSandersonMS do we know why/how the file is locked? |
Confirmed the bug. It's the running winforms app which is holding onto the lock:
|
On second thought though, why is the running app using the |
Yep, not sure what or why it is being blocked, but during development it must stay in the original wwwroot folder. |
I believe this is likely a bug in Visual Studio, specifically related to how it handles file sharing for write (save) operations. On the Blazor Hybrid WebView end, we request the file from the assembly here: This in turn goes through the file provider which uses the PhysicalFileInfo to open a read stream to the asset with So VS shouldn't have any trouble saving the file, unless it's trying to write to the file without Bug has been reported to VS/WinForms team here: https://developercommunity.visualstudio.com/t/Resource-Files-Locked-in-Blazor-Hybrid-P/10055002?viewtype=all / https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1546460 For reference; https://stackoverflow.com/a/3448307 |
Just an update, closed out the AZDO issue given this is likely not a VS issue, but rather an issue with how the |
@TanayParikh Does this mean we need to work around it by loading the content into memory and then passing a different stream into WebView2? (Or more efficiently, creating some stream that maps the file data into WebView2 without WebView2 knowing that it comes from a file) |
The CoreWebView2 team mentions this issue should be resolved in Edge 104. I'm attempting to validate, and hopefully we're able to close this issue out shortly. 😄 The additional stream specifically for the WebView is definitely an option if the issue isn't resolved in CoreWebView2. I've confirmed it does resolve the issue, ideally however we can avoid it, and the additional associated overhead. |
Looks like the CoreWebView2 issue hasn't been resolved unfortunately. They're planning on investigating appropriately. |
Just an update on this issue; we've engaged with |
Just an update for those tuning into this issue; continuing to engage with the |
Hot reload for CSS doesn't work for WinForms apps because the files are locked while the app is running, so you can't save changes to them.
Repro
The text was updated successfully, but these errors were encountered: