0
I am  running Ubuntu 16.04 and the Awesomium Web Browser C# Framework as well as Mono 4.4.2 with the environment variable MONO_PATH set to /usr/lib/mono/4.5 and the environment variable LD_LIBRARY_PATH set to /home/frankc/EnvironmentX64/Hybrid/Debug.

In the directory folder /home/frankc/EnvironmentX64/Hybrid/Debug, I have copies of the dll assembly awesomium , libffmpegsumo.so , libawesomium-1-7.so.0.0 , awesomium_process , Awesomium.Mono.dll , Awesomium.Core.dll and Awesomium.Mono.dll.

When I compile the following C# test program , it compiles okay with no errors.

// Credit: Awesomium v1.7.2 C# Basic Sample
//         by Perikles C. Stephanidis
using System;
using System.IO;
using Awesomium.Core;
using System.Threading;
using System.Diagnostics;
using System.Reflection;

namespace BasicSample
{
    class Program
    {
        static void Main( string[] args )
        {
            WebCore.Initialize(WebConfig.Default);

            Uri url = new Uri("http://www.google.com");
            Console.WriteLine("WE ARE HERE " + WebCore.PackagePath); 

            using ( WebSession session = WebCore.CreateWebSession(WebPreferences.Default) )
            {
                // WebView implements IDisposable. Here we demonstrate
                // wrapping it in a using statement.
                using ( WebView view = WebCore.CreateWebView( 1100, 600, session ) )
                {
                    bool finishedLoading = false;
                    bool finishedResizing = false;

                    Console.WriteLine( String.Format( "Loading: {0} ...", url ) );

                    // Load a URL.
                    view.Source = url;

                    // This event is fired when a frame in the
                    // page finished loading.
                    view.LoadingFrameComplete += ( s, e ) =>
                    {
                        Console.WriteLine( String.Format( "Frame Loaded: {0}", e.FrameId ) );

                        // The main frame usually finishes loading last for a given page load.
                        if ( e.IsMainFrame )
                            finishedLoading = true;
                    };

                    while ( !finishedLoading )
                    {
                        Thread.Sleep( 100 );
                        // A Console application does not have a synchronization
                        // context, thus auto-update won't be enabled on WebCore.
                        // We need to manually call Update here.
                        WebCore.Update();
                    }

                    // Print some more information.
                    Console.WriteLine( String.Format( "Page Title: {0}", view.Title ) );
                    Console.WriteLine( String.Format( "Loaded URL: {0}", view.Source ) );
                } // Destroy and dispose the view.
           } // Release and dispose the session.            

           // Shut down Awesomium before exiting.
            WebCore.Shutdown();

            Console.WriteLine("Press any key to exit...");
            Console.Read();
        }
    }
}

Here is the compiler command :

mcs -r:./Awesomium.Mono.dll Test.cs

Yet when I run mono ./Test.exe , I observe the following run-time exception:

System.DllNotFoundException: Could not locate the path to the native Awesomium library.
  at Awesomium.Core.WebCore.YFqkBlruD () <0x40641080 + 0x00853> in <filename unknown>:0 
  at Awesomium.Core.WebCore.EHyMTEo9AN () <0x4063cc30 + 0x00913> in <filename unknown>:0 
  at Awesomium.Core.WebCore.CreateWebView (Int32 width, Int32 height) <0x4063c9a0 + 0x00073> in <filename unknown>:0 
  at BasicSample.Program.Main (System.String[] args) <0x40620d70 + 0x000bb> in <filename unknown>:0 

Also, when I run mono ./Test.exe, I notice that the string WebCore.PackagePath is empty which is not what I expected since WebCore.PackagePath should point at the location for the dll assembly awesomium. Furthermore WebCore.PackagePath is a get property rather than a get and set property so I cannot change its value. Is there another similar property I could set to fix the System.DllNotFoundException: Could not locate the path to the native Awesomium library?

I have downloaded the GITHUB Awesomium WebBrowser C# source code and was unable to grep the string "Could not locate the path to the native Awesomium library".

strace mono ./Test.exe and export MONO_LOG_LEVEL=debug mono ./Test.exe revealed nothing immediately noticeable.

Could I find out the reason for the MonoSystem.DLLNotFoundException and how to fix it?

Today, I was able to compile, link and run the two Awesomium web browser C++ test programs and verify that they executed correctly.

Any help is greatly appreciated.

  • Did you export MONO_PATH and export LD_LIBRARY_PATH ? – Stephen Harris Jul 28 '16 at 20:58
  • @Stephen Harris, Thank you for your great comment. Yes, I exported MONO_PATH and LD_LIBRARY_PATH. – Frank Jul 28 '16 at 21:01
  • I searched the GITHUB mono/mono distribution archives for the string "Could not locate the path to the native Awesomium library" and could not find an exact match. – Frank Jul 28 '16 at 21:07
  • @Stephen Harris, If my C++ :Ubuntu Linux 16.04 test programs run perfectly well , then why do not my C# Ubuntu 16.04 tests run without a problem, They both share the same MONO_PATH and LD_LIBRARY_PATH> Thank you. – Frank Jul 29 '16 at 1:29
  • @Stephen Harris. I just answered the original question. Thank you for your help. – Frank Jul 29 '16 at 15:58
0

I discovered over the last 48 hours that the Awesomium's C# NET product has a lot of configuration problems and changing DLLImports which make it almost useless if you do not pay for support.

Our architect recommended spawning a web browser using C# which I just tested successfully.

using System;
using System.IO;
using System.Threading;
using System.Diagnostics;
using System.Reflection;

Process proc = new Process ();
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.FileName = "http://stackoverflow.com";
proc.Start ();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.