2016-03-07 30 views
1

我试图在Windows上使用Xamarin Studio构建C#桌面应用程序。导入LibGit2Sharp包(以及因此LibGit2Sharp.NativeBinaries包)后,任何企图实际使用的库导致的其中之一:Libgit2sharp在Windows上的Xamarin studio中内置时找不到git2 - *。dll

Exception in Gtk# callback delegate 
    Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: git2-785d8c4 
    at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_config_find_xdg (LibGit2Sharp.Core.Handles.GitBuf) 
    at LibGit2Sharp.Core.Proxy.ConvertPath (System.Func`2 pathRetriever) [0x00006] in <filename unknown>:0 
    at LibGit2Sharp.Core.Proxy.git_config_find_xdg() [0x00000] in <filename unknown>:0 
    at LibGit2Sharp.Configuration..ctor (LibGit2Sharp.Repository repository, System.String repositoryConfigurationFileLocation, System.String globalConfigurationFileLocation, System.String xdgConfigurationFileLocation, System.String systemConfigurationFileLocation) [0x00032] in <filename unknown>:0 
    at LibGit2Sharp.Configuration.BuildFrom (System.String repositoryConfigurationFileLocation, System.String globalConfigurationFileLocation, System.String xdgConfigurationFileLocation, System.String systemConfigurationFileLocation) [0x00000] in <filename unknown>:0 
    at LibGit2Sharp.Configuration.BuildFrom (System.String repositoryConfigurationFileLocation, System.String globalConfigurationFileLocation) [0x00000] in <filename unknown>:0 
    at bravura.tools.git.helper.operations.CoreSettings.run() [0x00015] in C:\code\bravura\git-helper\operations\CoreSettings.cs:37 
    at bravura.tools.git.helper.operations.CoreMenu.OnButtonOkReleased (System.Object sender, System.EventArgs e) [0x00020] in C:\code\bravura\git-helper\operations\CoreMenu.cs:43 
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,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) [0x00038] in C:\j\workspace\v\repos\mono\mcs\class\corlib\System.Reflection\MonoMethod.cs:295 

我发现,手动把根输出DLL和PDB目录整理了这个问题,但是这并不能构建出好的构建过程。真的,应该有一种方法将“NativeBinaries *”目录添加到加载路径。我已经尝试手动加载库,但由于它不是.NET,因此该选项无效。

我错过了一些明显的东西吗?这是一个常见的问题,我只是在瞎猜?

我已经检查了以下问题无济于事:

+1

如果你不想git2-785d8c4.dll是在同一目录下的.exe你,你可能将不得不使用[SetDllDirectory会](http://stackoverflow.com/questions/4958742/c -move-dll-files-from-root-to-sub-folder/4960063#4960063)并指定它的位置。 –

+0

无法找到该功能的名称空间,但在搜索时,我发现了一个似乎可行的修复程序。 – tzrlk

回答

相关问题