Skip to content

Instantly share code, notes, and snippets.

@nulltoken
Created May 24, 2012 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nulltoken/2781727 to your computer and use it in GitHub Desktop.
Save nulltoken/2781727 to your computer and use it in GitHub Desktop.
[LibGit2Sharp] Troubleshooting probing of the native dll on a network path
using System;
using System.IO;
using System.Reflection;
using LibGit2Sharp;
namespace ConsoleApplication2
{
internal class Program
{
private static void Main(string[] args)
{
string originalAssemblypath = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
string parentPath = Path.GetDirectoryName(originalAssemblypath);
string currentArchSubPath = "NativeBinaries/" + ProcessorArchitecture;
string path = Path.Combine(parentPath, currentArchSubPath);
Console.WriteLine("{0}-{1}", "originalAssemblypath", originalAssemblypath);
Console.WriteLine("{0}-{1}", "parentPath", parentPath);
Console.WriteLine("{0}-{1}", "currentArchSubPath", currentArchSubPath);
Console.WriteLine("{0}-{1}", "path", path);
Console.WriteLine();
Console.WriteLine(Repository.Version);
Console.ReadLine();
}
public static string ProcessorArchitecture
{
get
{
if (IntPtr.Size == 8)
{
return "amd64";
}
return "x86";
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment