Link to home
Create AccountLog in
Avatar of trevor1940

asked on

C#: Using alternate web browser on Win Forms

I'm tryingg to build a winforms app that uses the built in web browser

On loading a JavaScript hungry HTML5  page I get a number of error boxes similar to the image

User generated image
Google suggested doing this which didn't work   (Even running the "...\debug\AppName.exe" in admin mode allowed the regestry to be set but failed to load the page correctly

More googling suggested using the nuget package Geckofx60.64

I'm struggling to know how to install this as there are several when searching for Geckofx

I'm also unsure how to run even the simple example given

       static void Main(string[] args)
           var geckoWebBrowser = new GeckoWebBrowser {Dock = DockStyle.Fill};
           Form f = new Form();

Open in new window

Could someone start me of?

in my App I need to have real browser with at least 1 button that is used after the page loads to analyse the page using xpath queries
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of trevor1940



Could you give me a clue how to set this up?
Download the sample project
The problem is your "built in web browser" has problems processing some or all Javascript.

CefSharp is more of a Windows specific (code will never run anywhere else) solution.

Use if you'd like your code to run on any OS.
Downloaded Sample project
set CefSharp.Test as starup file
build caused a whole host of errors

"Severity      Code      Description      Project      File      Line      Suppression State
Error      CS0117      'TaskCreationOptions' does not contain a definition for 'RunContinuationsAsynchronously'      CefSharp.OffScreen.Example      D:\Vb\Test\CefSharp-master\CefSharp.OffScreen.Example\Program.cs      119      Active

have no clue what these mean or if i've done it wrong there dosn't seem to be an install guide

I'm unlikely to run this outside windows but will   try  tomorrow hopefully it will be a tad more straight forward
Best to open a ticket with CefSharp or post to one of their user forums for assistance with this.
I managed to get this to work This Tutorial

For anyone else reading this where it said edit *.csproj and App.config files I did it with Visual Studio closed using an external xml / text editor
AT 2B I had to add new CPU and use  x86

Gave up on the download examples