单声道DLL配置

时间:2010-02-16 11:10:46

标签: c# svn mono c#-2.0

我正在尝试使用Svn.NET(http://www.pumacode.org/projects/svndotnet/)库来在我的Mono项目中使用。我尝试编译它的mockapp - > svnmockapp项目(http://www.pumacode.org/projects/svndotnet/browser/trunk/SvnMockApp),我能够正确获取引用并将其编译正确。

我知道它引用了另外两个模块libapr(libapr-1.so.0)和svn_client(libsvn_client-1.so.0),我在/ bin /中创建了PumaCode.SvnDotNet.dll.config调试。

这就是我所做的一切,试图让mockapp至少输出一些东西来证明它确实是SVN的接口。然而,它不起作用。

输入的不与SVN接口的命令正常工作:

$ mono SvnTest.exe -usage
Usage: SvnTest <subcommand> [options]
Short Options: ~?.V
Subcommands: add, checkout[co], status[st], update[up]
For help on subcommands, use the -?/--help subcommand option.

尝试访问SVN的命令会引发异常:

$ mono SvnTest.exe st
An exception was thrown by the type initializer for PumaCode.SvnDotNet.AprSharp.Apr

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at PumaCode.SvnDotNet.SubversionSharp.SvnMockApp.CmdBase.Run (PumaCode.SvnDotNet.SubversionSharp.SvnMockApp.SubCommand sc, System.String[] args) [0x00000]
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000]
  at PumaCode.SvnDotNet.SubversionSharp.SvnMockApp.Application.Run (System.String[] args) [0x00000]
  at PumaCode.SvnDotNet.SubversionSharp.SvnMockApp.Application.Main (System.String[] args) [0x00000]

使用MONO_DEBUG_LEVEL =“debug”,我们得到以下日志粘贴here

在日志的尾端,我们看到了:

.
.
.
Mono-INFO: DllImport attempting to load: 'libapr-1'.
Mono-INFO: DllImport loading location: 'libapr-1.so'.
Mono-INFO: DllImport error loading library: 'libapr-1.so: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport loading library: './libapr-1.so'.
Mono-INFO: DllImport error loading library './libapr-1.so: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport loading: 'libapr-1'.
Mono-INFO: DllImport error loading library 'libapr-1: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport attempting to load: 'libapr-1'.
Mono-INFO: DllImport loading location: 'libapr-1.so'.
Mono-INFO: DllImport error loading library: 'libapr-1.so: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport loading library: './libapr-1.so'.
Mono-INFO: DllImport error loading library './libapr-1.so: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport loading: 'libapr-1'.
Mono-INFO: DllImport error loading library 'libapr-1: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport attempting to load: 'libapr-1'.
Mono-INFO: DllImport loading location: 'libapr-1.so'.
Mono-INFO: DllImport error loading library: 'libapr-1.so: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport loading library: './libapr-1.so'.
Mono-INFO: DllImport error loading library './libapr-1.so: cannot open shared object file: No such file or directory'.
Mono-INFO: DllImport loading: 'libapr-1'.
Mono-INFO: DllImport error loading library 'libapr-1: cannot open shared object file: No such file or directory'.
An exception was thrown by the type initializer for PumaCode.SvnDotNet.AprSharp.Apr

我已经尝试将SvnTest.exe所在目录中的相应模块符号链接,但这仍然存在。

我该如何解决这个问题?

我是否将PumaCode.SvnDotNet.dll.config放在错误的文件夹中? (我将它放在/ bin / Debug并尝试/ bin)

我该怎么做才能解决这个问题?

感谢您的帮助!非常感谢!

继承配置文件:

(PumaCode.SvnDotNet.dll.config)

<configuration>
     <dllmap dll="libapr" target="/usr/lib/libapr-1.so.0"/>
     <dllmap dll="svn_client-1" target="/usr/lib/libsvn_client-1.so.0"/>
</configuration>

2 个答案:

答案 0 :(得分:0)

您的配置文件没有正确的dll引用。在日志中,Mono尝试加载libapr-1库,但您的配置文件只有libapr的条目。我认为正确的映射应该是:

<configuration>
    <dllmap dll="libapr-1" target="/usr/lib/libapr-1.so.0"/>
    <dllmap dll="svn_client-1" target="/usr/lib/libsvn_client-1.so.0"/>
</configuration>

答案 1 :(得分:0)

通过手动将dllmap添加到/ etc / mono / config解决它,而不是最好的方法,但至少它起作用。