本文介绍了使用CEFSharp Web浏览器中的ClickOnce发布崩溃WPF应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的WPF应用程序,它工作在调试正常,但当我做的ClickOnce发布其崩溃试图加载CEFSharp网页浏览器时,



我有一个登录页面,用户点击,然后打开的浏览器一旦点击我碰到下面的错误



> <TabItem Header="Web Page" Name="CefWebPage">
>                 <Grid Background="#FFE5E5E5" Margin="0">
>                     <Grid.ColumnDefinitions>
>                         <ColumnDefinition Width="871*"/>
>                     </Grid.ColumnDefinitions>
>                     <views:CefSharpWebBrowserUserControl x:Name="CefSharpWebBrowserUserControl"></views:CefSharpWebBrowserUserControl>
>                 </Grid>
>             </TabItem>

code behind

    public partial class CefSharpWebBrowserUserControl : UserControl
    {
        public CefSharpWebBrowserUserControl()
        {
            InitializeComponent();
            var settings = new CefSettings();
            settings.PackLoadingDisabled = true;
            WebBrowser = new ChromiumWebBrowser();
            WebBrowser.Address = "www.google.com";
            BrowserGrid.Children.Add(WebBrowser);
        }

        public ChromiumWebBrowser WebBrowser { get; set; }
    }
}
解决方案

ClickOnce by default doesn't include the unamanged resources that CefSharp requires. There are many issues that already address this topic.

Here are a couple of useful ones

Searching the GitHub project is always an excellent resource.https://github.com/cefsharp/CefSharp/search?q=clickonce&type=Issues&utf8=%E2%9C%93

You also need to make sure VC++ Redist is installed on your target machines. See https://github.com/cefsharp/CefSharp#version-branches for more info one which VC++ version you require.

In general, please try searching GitHub/StackOverflow before posting your question.

这篇关于使用CEFSharp Web浏览器中的ClickOnce发布崩溃WPF应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 16:44