Try using
LoadLibraryEx
instead:
[DllImport("kernel32.dll", CharSet=CharSet::Auto, EntryPoint="LoadLibraryEx")]
private static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hFile, uint dwFlags);
System.IntPtr moduleHandle = LoadLibraryEx(libPath, IntPtr.Zero, 0);
You need to give us more info on the exception, specifically what opject/method it's happening on. In fact, you might also want to ask this question on the MSDN WPF forum.