Your method of determining the assembly path is not working all the time. An example is: If you have a # sign in your path, it will get stripped off by the Uri:
string codeBase = Assembly.GetExecutingAssembly().CodeBase; // "file://D:/Dev/C#/Projects/../../Test.exe"
string originalAssemblypath = new Uri(codeBase).LocalPath; // "D:\Dev\C"
You should use this method of getting the location:
string originalAssemblypath = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName
The location attribute stores a more system friendly path to the running executable.
Fix detection of the path to the native libraries
Prevent the path from being truncated when it contains a hash (#).
Wow. Very cool bug report!
The fix has been merged in vNext.