You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GetContentAsync() of the event WebResourceResponseReceived event throws a ComException, when posting content that exceeds 123290000 bytes (files of about 125 MB size).
This happens for WinForms and WPF apps, and it happens for the latest SDK 1.0.2210.55, but for an older SDK 1.0.1587.40 as well.
I have not tested it with other runtimes than 120.0.2210.121
It is reproducable for me, so that it works every time for a smaller post size, e.g. 123289000 bytes, and it throws the exception every time I post the longer content with at least 123290000 bytes.
since I have a workaround the importance is moderate for me, but for other use cases it could be important / blocking as well.
GetContentAsync threw an exception: System.Runtime.InteropServices.COMException (0xFFFF8300): 0xFFFF8300
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at Microsoft.Web.WebView2.Core.CoreWebView2WebResourceResponseView.GetContentAsync()
at WebView2PostTest.WebView.CoreWebView2_WebResourceResponseReceived(Object sender, CoreWebView2WebResourceResponseReceivedEventArgs e)
Importance
Moderate. My app's user experience is affected, but still usable.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
120.0.2210.121
SDK Version
1.0.2210.55
Framework
Winforms
Operating System
Windows 10
OS Version
19045.3803 (22H2)
Repro steps
In a .NET8 Sample application add webview2 winforms control.
Using following code sample, which includes a test server on localhost:8080
(the problem exists for both WinForms and WPF)
using Microsoft.Web.WebView2.Core;using System.Diagnostics;using System.Net;using System.Text;namespaceWebView2PostTest{publicpartialclassWebView:Form{conststringTestUrl="http://localhost:8080/";publicWebView(){
InitializeComponent();
webViewControl.CoreWebView2InitializationCompleted +=WebViewControl_CoreWebView2InitializationCompleted;
InitializeAsync();}privateasyncvoidInitializeAsync(){await webViewControl.EnsureCoreWebView2Async();}privatevoidWebViewControl_CoreWebView2InitializationCompleted(object?sender,CoreWebView2InitializationCompletedEventArgse){
webViewControl.CoreWebView2.WebResourceResponseReceived +=CoreWebView2_WebResourceResponseReceived;
webViewControl.CoreWebView2.NavigationCompleted +=CoreWebView2_NavigationCompleted;// start the testserver
Debug.WriteLine($"Start test server on {TestUrl}");
StartTestServer();// works//long length = 123289000;// does not worklonglength=123290000;// System.Runtime.InteropServices.COMException (0xFFFF8300): 0xFFFF8300// at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)// at Microsoft.Web.WebView2.Core.CoreWebView2WebResourceResponseView.GetContentAsync()// at WebView2PostTest.WebView.CoreWebView2_WebResourceResponseReceived(Object sender, CoreWebView2WebResourceResponseReceivedEventArgs e)CoreWebView2WebResourceRequestwebResourceRequest=
webViewControl.CoreWebView2.Environment.CreateWebResourceRequest(
TestUrl,"POST",new MemoryStream(newbyte[length]),"");// post the request
Debug.WriteLine($"NavigateWithWebResourceRequest: POST content with {length} bytes.");
webViewControl.CoreWebView2.NavigateWithWebResourceRequest(webResourceRequest);}privatevoidCoreWebView2_NavigationCompleted(objectsender,CoreWebView2NavigationCompletedEventArgse){
Debug.WriteLine($"NavigationCompleted: {webViewControl.Source.AbsoluteUri}");}privateasyncvoidCoreWebView2_WebResourceResponseReceived(object?sender,CoreWebView2WebResourceResponseReceivedEventArgse){
Debug.WriteLine($"WebResourceResponseReceived for {e.Request.Uri}");if(e.Request.Uri ==TestUrl){
Debug.WriteLine($"GetContentAsync");try{Streamcontent=await e.Response.GetContentAsync();
Debug.WriteLine($"GetContentAsync was successful: \"{new StreamReader(content).ReadToEnd()}\"");}catch(Exceptionex){
Debug.WriteLine($"GetContentAsync threw an exception: {ex}");}}}privatevoidStartTestServer(){varserverTask= Task.Run(()=>{HttpListenerlistener=new HttpListener(); listener.Prefixes.Add(TestUrl); listener.Start();while(true){HttpListenerContextcontext= listener.GetContext(); context.Response.StatusCode =(int)HttpStatusCode.OK;MemoryStreammemoryStream=new MemoryStream(); context.Request.InputStream.CopyTo(memoryStream); context.Response.Headers.Set("Content-Type","text/plain");StringWriteroutputWriter=new StringWriter(); outputWriter.Write($"Response for requested URL {context.Request.Url.AbsoluteUri} with status code {context.Response.StatusCode}."); outputWriter.Write($" ({memoryStream.Length} bytes have been received.)"); context.Response.OutputStream.Write(Encoding.UTF8.GetBytes(outputWriter.ToString())); context.Response.OutputStream.Close();}});}}}
Repros in Edge Browser
No
Regression
Don't know
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered:
What happened?
GetContentAsync() of the event WebResourceResponseReceived event throws a ComException, when posting content that exceeds 123290000 bytes (files of about 125 MB size).
This happens for WinForms and WPF apps, and it happens for the latest SDK 1.0.2210.55, but for an older SDK 1.0.1587.40 as well.
I have not tested it with other runtimes than 120.0.2210.121
It is reproducable for me, so that it works every time for a smaller post size, e.g. 123289000 bytes, and it throws the exception every time I post the longer content with at least 123290000 bytes.
since I have a workaround the importance is moderate for me, but for other use cases it could be important / blocking as well.
Importance
Moderate. My app's user experience is affected, but still usable.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
120.0.2210.121
SDK Version
1.0.2210.55
Framework
Winforms
Operating System
Windows 10
OS Version
19045.3803 (22H2)
Repro steps
In a .NET8 Sample application add webview2 winforms control.
Using following code sample, which includes a test server on localhost:8080
(the problem exists for both WinForms and WPF)
Repros in Edge Browser
No
Regression
Don't know
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: