Closed MG1376 closed 2 years ago
Hi @MG1376 , how are the images being loaded, and how are they being deleted? We'll need to see what code you're using so that we can try to reproduce this and debug it.
Hi, The component that image resides is opened using 'Radzen Dialog' with an 'img' tag inside the component to load the image with a src that points to file on disk. I implement IDisposable in the component and dispose the reference (<img @ref="img" />) and then set it to null in the dispose method.
I had to change the code and rewrite it with an api action method, Now it works. But since using src that directly references a file on disk is easier, I wanted to know why using the original way interfere with deleting. For video/audio the same thing happens and I had to rewrite the code using api method.
BTW I transfered the issue to the .NET MAUI repo, which is where we support the BlazorWebView that you appear to be using.
with a src that points to file on disk
Can you show the exact code you're using? There are many possibilities here and we'll need to see exactly what code you have so that we can investigate the right thing.
Hi @MG1376. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@Eilon we have seen this in a different form (with CSS) I believe this is due to the way webview2 accesses the files that locks them in place.
@javiercn oh that issue? Certainly could be. Do you have a link?
Thanks for contacting us. This is a dupe of https://github.com/dotnet/maui/issues/7479
I use a radzen Blazor datagrid to show some image links, when user clicks the link and Image shows, then deleting the image or record fails and says 'The process cannot access the file because it is being used by another process.' I tested showing the image with a built in new window and also a radzen dialog service, with the same error. I also tested this with audio and video.
Only if I don't see the image or the audio/video preload='none' and I don't play the media, the file is deletable. I use .Net 6 with windows forms and Blazor and Microsoft.AspNetCore.Components.WebView.WindowsForms webview package. Is this a webview problem or there is a solution?