Skip to content

[Problem/Bug]: WebView2CompositionControl). #5163

Open

Description

What happened?

#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

Activity

  1. SoulsideJourney commented on Mar 14, 2025

    @SoulsideJourney

    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.

  2. SoulsideJourney commented on Mar 14, 2025

    @SoulsideJourney

    Setting SupportedOSPlatformVersion to 10.0.17763.0 in the project file solved the problem

  3. CarnationRED commented on Mar 29, 2025

    @CarnationRED

    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.

  4. sivMSFT commented on Mar 31, 2025

    @sivMSFT

    Hi Davide mercanti (@merco) and SoulsideJourney, are you still experiencing the same issue, or has it been resolved?

  5. merco commented on Mar 31, 2025

    @merco
    Author

    Siv Souvam (MSFT) (@sivMSFT) I did as
    SoulsideJourney suggested, but is it the correct procedure or a workaound?

  6. SoulsideJourney commented on Mar 31, 2025

    @SoulsideJourney

    Davide mercanti (@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.

  7. nhoefer2 commented on Apr 9, 2025

    @nhoefer2

    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

  8. bdovaz commented on Apr 11, 2025

    @bdovaz

    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 Siv Souvam (MSFT) (@sivMSFT)

  9. mtinnes commented on Apr 14, 2025

    @mtinnes

    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

  10. mtinnes commented on Apr 22, 2025

    @mtinnes

    Also, I'm not getting NavigationCompleted events anymore. Wonder if this has anything todo with the forced TargetFramework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions