0

I have a C# Class Library that is using the 4.8 .Net Framework, within that I have a Windows Form that I want to use the WebView2 control on. When I add the latest stable version (1.0.2651.64) via NuGet, this includes the following:

  • Microsoft.Web.WebView2.Core
  • Microsoft.Web.WebView2.WinForms
  • Microsoft.Web.WebView2.Wpf

I can add the WebView2 control to the form and interact as required.

However when I save the Project and close it, then re-open it I get 4 missing references:

  • C:\Safe\ClassLibrary1\packages\Microsoft.Web.WebView2.1.0.2651.64\build..\lib_manual\net6.0-windows10.0.17763.0\Microsoft.Web.WebView2.Core.Projection.dll
  • C:\Safe\ClassLibrary1\packages\Microsoft.Web.WebView2.1.0.2651.64\build..\lib_manual\netcoreapp3.0\Microsoft.Web.WebView2.Core.dll
  • C:\Safe\ClassLibrary1\packages\Microsoft.Web.WebView2.1.0.2651.64\build..\lib_manual\netcoreapp3.0\Microsoft.Web.WebView2.WinForms.dll
  • C:\Safe\ClassLibrary1\packages\Microsoft.Web.WebView2.1.0.2651.64\build..\lib_manual\netcoreapp3.0\Microsoft.Web.WebView2.Wpf.dll

I can't figure why these references would be needed when I have correct References to:

  • C:\Safe\ClassLibrary1\packages\Microsoft.Web.WebView2.1.0.2651.64\lib\net462\Microsoft.Web.WebView2.Core.dll
  • C:\Safe\ClassLibrary1\packages\Microsoft.Web.WebView2.1.0.2651.64\lib\net462\Microsoft.Web.WebView2.WinForms.dll
  • C:\Safe\ClassLibrary1\packages\Microsoft.Web.WebView2.1.0.2651.64\lib\net462\Microsoft.Web.WebView2.Wpf.dll

I've deleted the missing references, re-compiled, no issues, save it, no problems. Closed the Project, then re-open and the missing references re-appear.

I've tried creating projects under mapped drives, also on my C drive and under C:\Users\ and all with the same problem.

I'm using VS2022 and running as Admin.

Any suggestions?

1 Answer 1

0

The issue is caused by the continued flaky implementation of this Control. This issue has happened a number of times before in "stable" builds, see https://github.com/MicrosoftEdge/WebView2Feedback/issues/1722

I downgraded to the previous stable build of 1.0.2592.51 and the issue goes away.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.