MicrosoftEdge / WebView2Samples

Microsoft Edge WebView2 samples
850 stars 463 forks source link

WebView2WindowsFormsBrowser fails because of .NETFramework v=4.6.2 dependency #102

Open fenchu opened 3 years ago

fenchu commented 3 years ago

Nice if you could upgrade this to newer .NET 5 or 6. because .NET 4.6.2 is blocked from installing on win10

I tried running: dotnet tool install -g upgrade-assistant upgrade-assistant.exe upgrade .\WebView2WindowsFormsBrowser.csproj

It goes through, but when I clean or rebuild I still get warnings about .NET v462 missing.

fenchu commented 3 years ago

Needed to explicitly set net5-windows:

-    <TargetFrameworks>net462</TargetFrameworks>
+    <TargetFrameworks>net5-windows</TargetFrameworks>
-    <Configurations>Debug;Release;Win7 Release;Win7 Debug</Configurations>
+    <Configurations>Debug;Release;Win10 Release;Win10 Debug</Configurations>
liminzhu commented 3 years ago

Thanks for opening the issue! Tracking this as a bug on our end.

MikeyWetzel commented 2 years ago

This is still a problem. Simple facts remain: (1) this code does not build in it's present form, and (2) this years-old code is the only official sample code released on how to use WebView2 in C#.

ext2txe commented 5 months ago

wow! it's April 2024 and it still does not run. nice