title: loadlibrary fails with error code 127
body: <p>I've a very interesting problem. It's sounds very easily, but I didn't finf any information about it.</p>
  
  <p>I've a C# solution with excel Add-in and winforms application and library project with only one method.</p>
  
  <p>project with library have next code:</p>
  
  <pre><code>[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)]
  public static extern IntPtr LoadLibrary(string filename);
  public sealed class LibraryInfo
  {
      public readonly IntPtr Handle;
      public LibraryInfo(string dllName)
      {
          Handle = LoadLibrary(dllName);
      }
  }
  public LibraryInfo GetLib(string name)
  {
      return new LibraryInfo(name);
  }
  </code></pre>
  
  <p>Look's like simple. 
  So I've a call of that method from add-ins and from WinForms</p>
  
  <p>I've a Dll, builded for x64 platform and x86 platform.</p>
  
  <p>And now magic:
  LoadLibrary returns <strong>error code 127</strong> <strong><em>only</em></strong> when I run it from Add-in and x64 configuration and on <strong>excel-2016</strong>(<strong>x64</strong>, ofcourse). When I run it on x86, or winform (both x86 and x64) it works. And it is not all, when I run it on Excel 2013 it's works fine too!!!</p>
  
  <p>mayby somebody knows?</p>