WebView2Feedback
WebView2Feedback copied to clipboard
[Problem/Bug]: WebView2CompositionControl).
What happened?
https://github.com/MicrosoftEdge/WebView2Feedback/issues/286
After webview2 upgrade (WPF version, net8.0-windows) to 1.0.3124.44
I Get this error using WebView2CompositionControl instead of WebView2
Could not load file or assembly 'Microsoft.Windows.SDK.NET, Version=10.0.17763.24, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Impossibile trovare il file specificato.'
and I can't install it in my project NU1213: Il pacchetto Microsoft.Windows.SDK.NET.Ref 10.0.26100.57 contiene un tipo di pacchetto DotnetPlatform che non è compatibile con questo progetto. Il pacchetto 'Microsoft.Windows.SDK.NET.Ref 10.0.26100.57' contiene un tipo di pacchetto 'DotnetPlatform' che non è supportato dal progetto 'WpfControlS3D'.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
133.0.3065.92
SDK Version
1.0.3124.44
Framework
WPF
Operating System
Windows 10
OS Version
22H2 19045.5608
Repro steps
WPF version, net8.0-windows
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
Exactly the same problem. Stacktrace:
at Microsoft.Web.WebView2.Wpf.WebView2CompositionControl.WebView2CompositionControl_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Old HWND WebView2 works fine.
Setting SupportedOSPlatformVersion to 10.0.17763.0 in the project file solved the problem
You can also find nuget package microsoft.windows.sdk.net.ref and copy both WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll to your build folder.
Hi @merco and @SoulsideJourney, are you still experiencing the same issue, or has it been resolved?
@merco Acccording to learn.microsoft.com, WebView2 doesn't support Windows 7 after version 109. So I guess SupportedOSPlatformVersion = 10.0.17763.0 as a minimum version is a requiered setting.
I had the same problem and was able to resolve it when putting this in the csproj file
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
"net8.0-windows" by itself is not sufficient
I have the same problem, and in the release notes there is no mention of it.
I don't know if this dependency has been introduced that now requires a minimum version of Windows 10.0.17763.24 when previously there was none and used the one from TFM (7.0 in the case of .NET9).
In this case there is no official documentation that this control has this dependency and how to fix it. In this page there is not a single reference to any of this and promises that it is simply switching from one control to another and everything works the same because they share the IWebView2 interface.
Or if on the contrary it is a bug and that dependency is not expected.
cc @sivMSFT
Same. In my case I had to use the following: <TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
Using WebView2 nuget version: 1.0.3179.45
Also, I'm not getting NavigationCompleted events anymore. Wonder if this has anything todo with the forced TargetFramework.