Replies: 3 comments
-
Thanks for reaching out. I've assigned this to a dev that can help follow up on this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Is there a solution to this problem now? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Anything new? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following code:
Doing this results in the contents of
abc.html
being rendered in the webview, HOWEVER, even after the full stream has been processed by the webview the stream passed in is not disposed.I know one solution would be for me to stream the entire file into a memorystream before passing it back to
e.Response
and closing the original filestream, however for large files this would be prohibitive and slow.As such I'm wondering if one of the following two resolutions are possible?
CreateWebResourceResponse
function called to the tune of "closeStreamWhenDone" or something to that effect, that will ensure that WebView2, calls the close function once it is completed with the streamThe other solution that I can think of is making my own stream that wraps the FileStream, and auto closes the underlying stream when it reaches the end. This is only really safe to do if WebView2 never uses the Seek or Position to investigate the file once the end of the stream has been reached (which I think is safe to assume, but I still think there is likely a cleaner solution that can be incorporated directly into WebView2).
Or maybe there is another cleaner solution I didn't even think of? Would love any suggestions here too.
Beta Was this translation helpful? Give feedback.
All reactions