
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.
ディレクトリフォルダ/home/frankc/EnvironmentX64/Hybrid/Debug dllアセンブリawesomium、libffmpegsumo.so、libawesomium-1-7.so.0.0、awesomium_process、Awesomium.Mono.dll、Awesomium.Coreのコピーがあります. dllとAwesomium.Mono.dll。
次のC#テストプログラムをコンパイルすると、エラーなしでうまくコンパイルされます。
// 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();
}
}
}
以下はコンパイラコマンドです。
mcs -r:./Awesomium.Mono.dll Test.cs
ただし、mono ./Test.exe を実行すると、次のランタイム例外が発生します。
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
また、mono ./Test.exeを実行すると、WebCore.PackagePath文字列が空であることがわかります。これは、WebCore.PackagePathがdllアセンブリawesomemiumの場所を指す必要があるため、期待したものとは異なります。また、WebCore.PackagePath は get 属性と set 属性ではなく get 属性なので、その値を変更することはできません。 System.DllNotFoundException:デフォルトのAwesomiumライブラリへのパスが見つからないことを修正するために設定できる他の同様のプロパティはありますか?
GITHUB Awesomium WebBrowser C#のソースコードをダウンロードしましたが、「デフォルトのAwesomiumライブラリへのパスが見つかりません」という文字列が見つかりませんでした。
strace mono ./Test.exe と import MONO_LOG_LEVEL=debug mono ./Test.exe はすぐに明らかな内容を開示していません。
MonoSystem.DLLNotFoundExceptionの原因と解決策を見つけることができますか?
今日、私は2つのAwesomium WebブラウザC ++テストプログラムをコンパイル、リンク、実行し、正しく実行されていることを確認できました。
どんな助けでも大変感謝します。
答え1
過去48時間の間に、私はAwesomiumのC#NET製品に多くの構成問題があり、DLLImportsが絶えず変更されており、サポート費用を支払わなければほとんど役に立たないことがわかりました。
私たちの設計者はC#を使ってWebブラウザを作成することを提案しましたが、ちょうどうまくテストしました。
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 ();