title: How to load DLL generated from python code into VB .Net
body: <p>I have a custom DLL created from Python which have simple functions to do sum/difference. I am trying to call there functions in my VB application but it is not working.</p>
  <pre><code>Module testfunc
       Public Declare Function do_sum Lib “testfunc.dll” (ByVal a As Integer, ByVal b As Integer) As Integer
       Public Declare Function do_diff Lib “testfunc.lib” (ByVal a As Integer, ByVal b As Integer) As Integer
  End Module
  
  Module Program
   Sub Main(args As String())
      Console.WriteLine(&quot;Hello World!&quot;)
      Dim result As Double, result2 As Integer
  
      result = do_sum(12, 34)
      Console.WriteLine(&quot;sum = {0}&quot;, result)
  
      result2 = do_diff(129, 34)
      Console.WriteLine(&quot;diff = {0}&quot;, result2)
  End Sub
  End Module
  </code></pre>
  <p>I have kept the DLL and LIB both in BIN folder. but as soon as I try to run the code I'll get the error
  <strong>'Unable to load DLL 'testfunc.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)'</strong></p>
  <p><strong>Solutions I tried</strong></p>
  <ol>
  <li>I tried registering the DLL using regsvr 32 it didn't worked.</li>
  <li>I tried adding the DLL as a resource from dependency but it is also not working.</li>
  <li>I tried giving the whole path of the DLL also but got the same error mentioned.</li>
  </ol>
  <p>Can anyone help me to understand what can be the issue and how I can resolve this please.</p>