WebView2 non gestisce file superiori a KB 1500 ?

di il
3 risposte

WebView2 non gestisce file superiori a KB 1500 ?

Ciao,
utilizzo il componente WebView2 con WinForms e carico un file HTML di circa 25 Mb.

Se lo caricon con il browser Edge (da Windows per capire) nessun problema: velocissimo nell'apertura e nessun errore nella console.

Se invece lo carico tramite Microsoft.Web.WebView2 mi da il seguente errore:
System.ArgumentException
HResult=0x80070057
Message=Value does not fall within the expected range.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>

Ho iniziato a "tagliarle" lo script ed ho notato che con una dimensione di circa KB 1500 di file WebView2 funziona tranquillamente.
Mentre con KB 29'000 originale da il seguente errore (debug di Visual Studio):

Le informazioni su come richiamare il debug JIT (Just-In-Time) anziché questa finestra
sono riportate in fondo al messaggio.
************** Testo dell'eccezione **************
System.ArgumentException: Value does not fall within the expected range.
   at Microsoft.Web.WebView2.Core.Raw.ICoreWebView2.NavigateToString(String htmlContent)
   at Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(String htmlContent)
   at Microsoft.Web.WebView2.WinForms.WebView2.NavigateToString(String htmlContent)
   at FOS.FormFos.LoadMapIdxHtml() in C:\Users\jocke\source\repos\2019\C#\FOS\FOS\FormFos.cs:line 77
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
Mi date qualche dritta per piacere ?
Grazie.



------------------------------------------------------------------------
Lascio anche il seguente output se può essere utile.. (è dato dall'esecuzione del file.exe)
------------------------------------------------------------------------

Le informazioni su come richiamare il debug JIT (Just-In-Time) anziché questa finestra
sono riportate in fondo al messaggio.

************** Testo dell'eccezione **************
System.ArgumentException: Value does not fall within the expected range.
at Microsoft.Web.WebView2.Core.Raw.ICoreWebView2.NavigateToString(String htmlContent)
at Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(String htmlContent)
at Microsoft.Web.WebView2.WinForms.WebView2.NavigateToString(String htmlContent)
at FOS.FormFos.LoadMapIdxHtml() in C:\Users\jocke\source\repos\2019\C#\FOS\FOS\FormFos.cs:line 77
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)


************** Assembly caricati **************
System.Private.CoreLib
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Private.CoreLib.dll
----------------------------------------
FOS
Versione assembly: 1.0.0.0
Versione Win32: 1.0.0.0
Base di codice: file:///C:/Users/jocke/source/repos/2019/C#/FOS/FOS/bin/Release/net5.0-windows/FOS.dll
----------------------------------------
System.Runtime
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Runtime.dll
----------------------------------------
System.Windows.Forms
Versione assembly: 5.0.17.0
Versione Win32: 5.0.1722.21504
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.17/System.Windows.Forms.dll
----------------------------------------
System.Windows.Forms.Primitives
Versione assembly: 5.0.17.0
Versione Win32: 5.0.1722.21504
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.17/System.Windows.Forms.Primitives.dll
----------------------------------------
System.ComponentModel.Primitives
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.ComponentModel.Primitives.dll
----------------------------------------
System.Runtime.InteropServices
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Runtime.InteropServices.dll
----------------------------------------
System.Drawing.Primitives
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Drawing.Primitives.dll
----------------------------------------
System.Collections.Specialized
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Collections.Specialized.dll
----------------------------------------
System.Drawing.Common
Versione assembly: 5.0.0.2
Versione Win32: 5.0.1221.52207
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.17/System.Drawing.Common.dll
----------------------------------------
System.Threading
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Threading.dll
----------------------------------------
System.Diagnostics.TraceSource
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Diagnostics.TraceSource.dll
----------------------------------------
System.Collections
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Collections.dll
----------------------------------------
Microsoft.Win32.Primitives
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/Microsoft.Win32.Primitives.dll
----------------------------------------
System.ComponentModel.EventBasedAsync
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.ComponentModel.EventBasedAsync.dll
----------------------------------------
System.Threading.Thread
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Threading.Thread.dll
----------------------------------------
Accessibility
Versione assembly: 4.0.0.0
Versione Win32: 5.0.1722.21504
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.17/Accessibility.dll
----------------------------------------
System.ComponentModel.TypeConverter
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.ComponentModel.TypeConverter.dll
----------------------------------------
Microsoft.Web.WebView2.WinForms
Versione assembly: 1.0.1210.39
Versione Win32: 1.0.1210.39
Base di codice: file:///C:/Users/jocke/source/repos/2019/C#/FOS/FOS/bin/Release/net5.0-windows/Microsoft.Web.WebView2.WinForms.dll
----------------------------------------
Microsoft.Web.WebView2.Core
Versione assembly: 1.0.1210.39
Versione Win32: 1.0.1210.39
Base di codice: file:///C:/Users/jocke/source/repos/2019/C#/FOS/FOS/bin/Release/net5.0-windows/Microsoft.Web.WebView2.Core.dll
----------------------------------------
mscorlib
Versione assembly: 4.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/mscorlib.dll
----------------------------------------
System.Private.Uri
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Private.Uri.dll
----------------------------------------
System.Runtime.Extensions
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Runtime.Extensions.dll
----------------------------------------
System.Memory
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Memory.dll
----------------------------------------
System.Diagnostics.FileVersionInfo
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Diagnostics.FileVersionInfo.dll
----------------------------------------
System.IO.FileSystem
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.IO.FileSystem.dll
----------------------------------------
Microsoft.Win32.SystemEvents
Versione assembly: 5.0.0.0
Versione Win32: 5.0.20.51904
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.17/Microsoft.Win32.SystemEvents.dll
----------------------------------------
System.Drawing
Versione assembly: 5.0.17.0
Versione Win32: 5.0.1722.21504
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.17/System.Drawing.dll
----------------------------------------
System.ComponentModel
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.ComponentModel.dll
----------------------------------------
System.Threading.Tasks
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Threading.Tasks.dll
----------------------------------------
System.Buffers
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Buffers.dll
----------------------------------------
System.Collections.NonGeneric
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Collections.NonGeneric.dll
----------------------------------------
System.Data.SQLite
Versione assembly: 1.0.116.0
Versione Win32: 1.0.116.0
Base di codice: file:///C:/Users/jocke/source/repos/2019/C#/FOS/FOS/bin/Release/net5.0-windows/System.Data.SQLite.dll
----------------------------------------
netstandard
Versione assembly: 2.1.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/netstandard.dll
----------------------------------------
System.Data.Common
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Data.Common.dll
----------------------------------------
System.Transactions.Local
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Transactions.Local.dll
----------------------------------------
System.Console
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Console.dll
----------------------------------------
System.Xml.ReaderWriter
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Xml.ReaderWriter.dll
----------------------------------------
System.Private.Xml
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Private.Xml.dll
----------------------------------------
System.Diagnostics.Tracing
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Diagnostics.Tracing.dll
----------------------------------------
System.Diagnostics.Process
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Diagnostics.Process.dll
----------------------------------------
System.Text.Encoding.Extensions
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Text.Encoding.Extensions.dll
----------------------------------------
System.ObjectModel
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.ObjectModel.dll
----------------------------------------
System.Linq
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Linq.dll
----------------------------------------
System.Threading.ThreadPool
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Threading.ThreadPool.dll
----------------------------------------
System.Windows.Forms.resources
Versione assembly: 5.0.17.0
Versione Win32: 5.0.1722.21504
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.17/it/System.Windows.Forms.resources.dll
----------------------------------------
System.Diagnostics.StackTrace
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Diagnostics.StackTrace.dll
----------------------------------------
System.Reflection.Metadata
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Reflection.Metadata.dll
----------------------------------------
System.Collections.Immutable
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.Collections.Immutable.dll
----------------------------------------
System.IO.MemoryMappedFiles
Versione assembly: 5.0.0.0
Versione Win32: 5.0.1722.21314
Base di codice: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.17/System.IO.MemoryMappedFiles.dll
----------------------------------------

************** Debug JIT **************

3 Risposte

Devi accedere o registrarti per scrivere nel forum
3 risposte