Click here to Skip to main content
15,909,747 members
Home / Discussions / WPF
   

WPF

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 3:09
cofounderChris Maunder16-Jul-09 3:09 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 3:05
cofounderChris Maunder16-Jul-09 3:05 
QuestionICommand Wpf form load properties? Pin
geomeo12330-May-24 14:11
geomeo12330-May-24 14:11 
AnswerRe: ICommand Wpf form load properties? Pin
Richard Deeming30-May-24 21:26
mveRichard Deeming30-May-24 21:26 
GeneralRe: ICommand Wpf form load properties? Pin
geomeo12314hrs ago
geomeo12314hrs ago 
QuestionWrapPanel / ItemsControl Problem Pin
Kevin Marois29-May-24 16:15
professionalKevin Marois29-May-24 16:15 
AnswerRe: WrapPanel / ItemsControl Problem Pin
Richard Deeming29-May-24 21:41
mveRichard Deeming29-May-24 21:41 
GeneralRe: WrapPanel / ItemsControl Problem Pin
Kevin Marois30-May-24 7:07
professionalKevin Marois30-May-24 7:07 
GeneralRe: WrapPanel / ItemsControl Problem Pin
Richard Deeming30-May-24 21:22
mveRichard Deeming30-May-24 21:22 
QuestionInitialize Webview2 in WPF Application work for windows user authentication Pin
Aditi Arora 202116-May-24 8:05
Aditi Arora 202116-May-24 8:05 
I am facing an exception while WebView initialize. It is working perfectly fine when i debug my code on VS 2019 but when i make an installer and install it on VM Windows 10 Machine it gives me an exception which i can get with help of Logs.
I have added UDF as well in my client machine and install Microsoft edge runtime(124.0.2478.97)

Please Suggest any one what i need to add to resolve this issue.

Code Block
MainWindow.xaml.cs
using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.Wpf; 
public MainWindow()
        {
           InitializeComponent();
           InitializeAndNavigateAsync( url);
        }
  public async Task InitializeAndNavigateAsync(string url)
        {
            await InitializeWebViewAsync();
            await NavigateToUrlAsync(url);
        }

        private async Task InitializeWebViewAsync()
        {
            try
            {
                log.Debug($"WebView2 initialize start");
                await webView.EnsureCoreWebView2Async(null);
                log.Debug($"WebView2 initialize stop");
            }
            catch (Exception e)
            {
                log.Debug($"WebView2 initialization failed.{e.Message}");
                log.Debug($"WebView2 initialization failed.{e.StackTrace}");
            }

        }

        private async Task NavigateToUrlAsync(string url)
        {
            try
            {
                log.Debug($"WebView2 NavigateToUrlAsync start");
                webView.CoreWebView2.Navigate(url);
                log.Debug($"WebView2 NavigateToUrlAsync stop");
            }
            catch (Exception e)
            {
                log.Debug($"WebView2 NavigateToUrlAsync failed.{e.Message}");
                log.Debug($"WebView2 NavigateToUrlAsync failed.{e.StackTrace}");

            }

        }

Exception is :
WebView2 initialization failed.Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))
2024-05-14 06:34:45.4923|DEBUG|debug|WebView2 initialization failed.   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.Web.WebView2.Core.CoreWebView2Environment.<CreateCoreWebView2ControllerAsync>d__80.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Web.WebView2.Wpf.WebView2.<>c__DisplayClass32_0.<<EnsureCoreWebView2Async>g__Init|0>d.MoveNext()
2024-05-14 06:34:45.4923|DEBUG|debug|WebView2 initialization failed.mscorlib

AnswerRe: Initialize Webview2 in WPF Application work for windows user authentication Pin
Dave Kreskowiak16-May-24 9:33
mveDave Kreskowiak16-May-24 9:33 
QuestionBinding Header in TabItem to child property in the ViewModel Pin
Kenneth Haugland28-Apr-24 21:57
mvaKenneth Haugland28-Apr-24 21:57 
QuestionDataGrid Built In ViewModel Question Pin
Kevin Marois8-Apr-24 13:24
professionalKevin Marois8-Apr-24 13:24 
AnswerRe: DataGrid Built In ViewModel Question Pin
Mycroft Holmes10-Apr-24 12:04
professionalMycroft Holmes10-Apr-24 12:04 
QuestionWPF .Net 6 Pin
Kevin Marois14-Mar-24 16:35
professionalKevin Marois14-Mar-24 16:35 
AnswerRe: WPF .Net 6 Pin
Pete O'Hanlon14-Mar-24 20:22
mvePete O'Hanlon14-Mar-24 20:22 
QuestionDependencyProperty fires only in ViewModel.ctor Pin
iwangoll25-Feb-24 7:34
iwangoll25-Feb-24 7:34 
AnswerRe: DependencyProperty fires only in ViewModel.ctor Pin
Richard Deeming25-Feb-24 22:44
mveRichard Deeming25-Feb-24 22:44 
GeneralRe: DependencyProperty fires only in ViewModel.ctor Pin
iwangoll26-Feb-24 1:51
iwangoll26-Feb-24 1:51 
GeneralRe: DependencyProperty fires only in ViewModel.ctor Pin
Richard Deeming26-Feb-24 2:19
mveRichard Deeming26-Feb-24 2:19 
GeneralRe: DependencyProperty fires only in ViewModel.ctor Pin
iwangoll26-Feb-24 3:16
iwangoll26-Feb-24 3:16 
QuestionGet Tab For Context Menu Pin
Kevin Marois26-Jan-24 18:35
professionalKevin Marois26-Jan-24 18:35 
QuestionINotifyDataErrorInfo Question Pin
Kevin Marois2-Jan-24 17:07
professionalKevin Marois2-Jan-24 17:07 
QuestionWhen Are All DependencyProperties Set Pin
Kevin Marois28-Dec-23 21:12
professionalKevin Marois28-Dec-23 21:12 
AnswerRe: When Are All DependencyProperties Set Pin
#realJSOP9-Apr-24 1:30
professional#realJSOP9-Apr-24 1:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.