After an exhausting(!!!) research over the internet, I managed to make it work!!! Here is the steps for anyone who want to use GeckoWebBrowser to his/her VB.NET project.
1. Create a new VB.NET project or just open an existing one.
2. Go to menu Project and click on Manage NuGet Packages.
3. Click on Browse tab and search for Geckofx45.
4. Choose the one with description: library that allows embeding gecko in C# applications and click Install button.
5. Close NuGet window and go to your project's Properties.
6. Into Application tab click the View Application Events button.
7. Delete everything in there and paste this part of code and save it.
Imports Gecko
Imports System.IO
Namespace My
' The following events are available for MyApplication:
'
' Startup: Raised when the application starts, before the startup form is created.
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
Partial Friend Class MyApplication
Protected Overrides Function OnStartup(ByVal eventArgs As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) As Boolean
Dim ProfileDirectory As String = My.Application.Info.DirectoryPath & "\Firefox\Profile"
If Not Directory.Exists(ProfileDirectory) Then
Directory.CreateDirectory(ProfileDirectory)
End If
Xpcom.ProfileDirectory = ProfileDirectory
Gecko.Xpcom.Initialize("Firefox")
Return True
End Function
End Class
End Namespace
8. Now, go back to your project Properties, click on Compile tab and set the Target CPU value to x86.
9. Build or Rebuild your project.
10a. To add GeckoWebBrowser control into your Toolbox, first create a new Tab by then name GeckoFX 45 or whatever you like.
10b. Right click on it and click on Choose Items.
10b. Go into .NET Framework Componetns and click Browse button.
10c. Find Geckofx-Winforms.dll into your-project-folder\packages\Geckofx45.45.0.34\lib\net45\ and click Open button.
10d. Make sure that GeckoWebBrowser is checked and then click OK.
Xpcom.Initialize("Firefox")prior to initializing the web browser. What happens if you put this before navigating in theForm.Loadevent? If it still doesn't work, also try removing the web browser from the form and create it through code after the Xpcom call.