Hello Chris,
Of course it makes sense what you write. The problem is that any project I restart working on after a few month or more, never works anymore which is frustrating. I must add to that that all the X# errors/ warnings were either quick to solve and those which were not were solved still quickly thanks to your (Robert and you) excellent support.
The real (hours wasting) problem, as so often, was VS. In my .xaml I noticed an Invalid Markup (instead of a preview) which used to work. Despite the 1st line below, in the 2nd line VS said not to have the faintest idea what
wv2 was (straight from the still valid MS sample how to use WebView2 in WPF)....
Code: Select all
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
<wv2:WebView2 Name = "webView"
I have tried the whole bag of tricks, including updates, repairs, cleans, starting over. One thing especially surprised me: when I wanted to add (even once in a freshly started C# Class library) I could
only add a WPF user control. At the very same time, in a full test WPF project with that WebView2 control in a WPF window (exactly the same xaml, working) I could add all WPF controls without problem. Do you happen to have an idea why? I would say that I originally also added the WPF window to the Class library using Add/New item.
As so often, after deciding to import the faulty pages using Add Existing item the error was gone. And...it was also gone in the original project (which I had only renamed since)...
I wonder if someone at Microsoft programs some timer based persistent error which totally freaks the user out for a few hours and after the set wasted time it silently starts working again.
At least now you know the background of my comment
Dick