-
Notifications
You must be signed in to change notification settings - Fork 54
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
failed with exception ='System.TypeLoadException on .NETFramework 4.6.2 #946
Comments
Hey @bunki-tou - thanks for the bug report. It looks like we may have inadvertently taken a dependency on an API not available in .NET 4.6.2. Can you try 4.7.1 and see if this error goes away? If it does that will confirm my suspicion and we'll have to investigate fixes on our end. |
@champnic Thanks for reply to my report. |
Same behaviour here. We have a customer with some Windows 10 2015 LTSB installations. Highest framework version, which can be installed is 4.6.2. So he can't update to 4.7.1. As a result WebView2 ist not usable in this environment, although documentation states, it should be possible. |
That's disappointing, sorry you're blocked by this. I've added this bug to our backlog and we'll try and get this fixed soon! |
Thanks for confirmig quickly. I'm looking forward to fix this! |
Thanks for the update - I've added this info and re-opened the bug. |
Hi @bunki-tou, Going back to read your description. It seems you mean that version 4.5.1 was working for you and only updating to 4.6.2 caused the issue? Would you mind confirm that it works for 4.5.1? |
@dianaqu The cause of the TypeLoadExceptions, shown in the previous StackTraces, are missing types System.Runtime.InteropServices.Architecture and System.Runtime.InteropServices.RuntimeInformation. Both were introduced in .NET Framework 4.7.1. So for my understanding it's impossible to run neither with 4.5.1 nor with 4.6.2. |
@dianaqu |
I also got TypeLoadExceptions on .Net 4.6.2, webview2 version 1.0.818.41. |
Hi folks on this thread. |
@dianaqu Thank you.
|
@bunki-tou @juergenil @paolodel @yudaming |
Hello, |
Hi @gpsaliola , Do you happen to have a repo machine that I can try to access? |
I'm sorry, no. I'm tested my app on a virtual machine created with VirtualBox. |
@dianaqu I'm sorry. I can't share my repo VM , because many development Apps were installed in this VM. @juergenil @paolodel @yudaming |
@dianaqu, Sorry, I can't give you access to our single equipment with Windows 10 2015 LTSB. |
I've create a simple example that runs on Windows 10 but crash in Windows 7. |
I saw on the Microsoft site that the RuntimeInformation class (which fails to load) has Framework 4.7.1 or higher as prerequisites. Could this be the problem since my app was compiled for Framework 4.5? |
That is indeed the crux of the issue, so we're working on a workaround for those RuntimeInformation properties that gives us the same info. The problem is not that your app was compiled for 4.5, but rather that it's being run with a .NET runtime that doesn't have the RuntimeInformation implementation (like 4.5 or 4.6). A workaround to get unblocked is to install a newer .NET runtime on the machines, or yes, to target a newer framework (these are not always options though, as described by other users above). |
Thanks for the explanation. |
@gpsaliola Please see step 1) here: It should be fine to have mixed dll versions. The only issue would be if you tried to run your app on a machine that only had a runtime < 4.7.2 and wasn't connected to the internet or able to update their runtime. |
thanks, this solves my problem.
|
This is fixed in the newest SDK package 1.0.1056-prerelease. Thanks! |
@champnic |
@superpapa This should be available in 1.0.1072.* which is coming out later this week or early next. Thanks! |
Description
My WebView2 Application(WinForms) failed with exception ='System.TypeLoadException on .NETFramework 4.6.2.
*stack trace
System.TypeLoadException: Could not load type 'System.Runtime.InteropServices.Architecture' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.LoadWebView2LoaderDll()
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Web.WebView2.WinForms.WebView2.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at biz.harmomedicalinstitution.cardreader.view.MainForm.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
Version
SDK: 1.0.7.5.50
Runtime: both 88.0.705.68 and 87.0.664.75
Framework: WinForms .NETFramework4.6.2 (update from 4.5.1)
OS: WindowsServer2012R2 (hyper-v)
hostOS:Windows10Pro 20H2
WebView2Sample.zip
Repro Steps
Screenshots
Additional context
#864 is similar to this.
AB#31786125
The text was updated successfully, but these errors were encountered: