【问题标题】:CefSharp-WPF : Application is not rendered in other PCCefSharp-WPF:应用程序未在其他 PC 中呈现
【发布时间】:2016-09-23 14:01:21
【问题描述】:

我是 CefSharp 的新手,所以我遵循了 CefSharp-WPF 的 first tutorial,它让我创建了一个新的应用程序。

但是,当我将此应用程序与bin/x64/release 目录中的文件夹复制到其他电脑时,它打开了应用程序,但页面不会呈现。

需要我为启动其他 PC 设置一些配置吗?

这是我的代码 sn-p。

MainWindow.xaml.cs

using CefSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using NetFwTypeLib;

namespace StocktalkPC
{
    /// <summary>
    /// MainWindow.xaml에 대한 상호 작용 논리
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {

            var settings = new CefSharp.CefSettings
            {
            };
            settings.CefCommandLineArgs.Add("disable-gpu", "1");
            Cef.Initialize(settings);

            InitializeComponent();
        }
    }
}

MainWindow.xaml

<Window x:Class="StocktalkPC.MainWindow"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:StocktalkPC"
        xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
        mc:Ignorable="d"
        Title="MainWindow" Height="700" Width="1260">
    <Grid>
        <cefSharp:ChromiumWebBrowser Grid.Row="0"
        Address="http://pc.dev.stocktalk.kr:30802/webchat" />
    </Grid>
</Window>

【问题讨论】:

    标签: wpf chromium-embedded cefsharp


    【解决方案1】:

    这是地址问题。我已将 ti 主机添加为该域,但它不是真正的域。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-19
      • 2015-09-26
      • 2018-08-20
      • 2018-10-02
      • 1970-01-01
      • 2016-01-15
      • 2012-07-12
      • 1970-01-01
      相关资源
      最近更新 更多