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 64/复合/调试中,我有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程序集awesomium的位置。此外,WebCore.PackagePath是get属性,而不是get和set属性,因此我不能更改它的值。我是否可以设置另一个类似的属性来修复System.DllNotFoundException:无法定位到本机Awesomium库的路径?
我已经下载了GITHUB C#源代码,并且无法实现grep字符串“无法找到本机Awesomium库的路径”。
strace ./Test.exe和导出MONO_LOG_LEVEL=debug mono ./Test.exe没有立即显示任何明显的信息。
我能找出MonoSystem.DLLNotFoundException的原因以及如何修复它吗?
今天,我能够编译、链接和运行两个Awesomium web浏览器C++测试程序,并验证它们是否正确执行。
任何帮助都是非常感谢的。
发布于 2016-07-29 15:56:38
在过去的48小时里,我发现Awesomium的C#网络产品有很多配置问题和改变的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 ();https://unix.stackexchange.com/questions/298964
复制相似问题