Showas always blank page

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

Showas always blank page

Postby TorstenR » Thu Oct 15, 2015 11:25 am

I used the unofficial CEF Glue NuGet packages currently available to build a simple test page in WPF, that only show up the browser.
But all what I try in the CEFSettings: I do always get a blank page. What is wrong here?

my app.cs lokks like this:
Code: Select all
public partial class App : Application
   {
      public App()
      {
         Exit += (o, e) =>
         {
            CefRuntime.Shutdown();
         };
      }
   }

My Window.xaml.cs:
Code: Select all
public partial class MainWindow : Window
   {
      public MainWindow()
      {
         CefRuntime.Load();

         var settings = new CefSettings();
         settings.SingleProcess = false;
         settings.MultiThreadedMessageLoop = true;
         settings.LogSeverity = CefLogSeverity.Verbose;
         settings.LogFile = "cef.log";
         settings.ResourcesDirPath = System.IO.Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetEntryAssembly().CodeBase).LocalPath);
         
         CefRuntime.Initialize(new CefMainArgs(new string[0]), settings, null, IntPtr.Zero);

         InitializeComponent();

         Loaded += (o, e) =>
         {
            //CefBrowser.NavigateTo("http://www.google.com");
            CefBrowser.NavigateTo("chrome://version/");
         };
      }
   }

And the window.xaml
Code: Select all
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wpf="clr-namespace:Xilium.CefGlue.WPF;assembly=Xilium.CefGlue.WPF"
        x:Class="WpfEvals.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid >
         <wpf:WpfCefBrowser Name="CefBrowser" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </Grid>
</Window>

Thats it. Environment: VS2013, Windows 8.1 x64. Project Platform Targets x86 (or I get a "bad Image exception" for AnyCPU/x64)

Thanks, Torsten
TorstenR
Newbie
 
Posts: 2
Joined: Thu Oct 15, 2015 11:14 am

Re: Showas always blank page

Postby TorstenR » Mon Oct 19, 2015 3:26 am

I found, this looks like the "trick" to get it run (also in debug mode):

Uncheck the option "Enable the Visual Studio hosting process" within Debug project settings.
TorstenR
Newbie
 
Posts: 2
Joined: Thu Oct 15, 2015 11:14 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 16 guests