Import Itaucripto DLL in VB

2

Hello, I am deploying the second via itaú ticket, however I am trying to work with ASP.NET VB and I do not have much knowledge in this language. I have done everything right and it is working locally, but when I go up to my hosting in Locaweb I get the following error

[HttpException (0x80004005): Could not create an object of type 'Itaucripto.cripto'.]

This error happens because itaucripto.dll is not installed in my hosting, I contacted the support and they said that they do not install the DLL on the server and that I should color the DLL inside my project and reference- in the application. How do I import this DLL into my application?

    
asked by anonymous 26.02.2015 / 21:28

2 answers

2

First Generate an Interop Assembly . This DLL is a COM Assembly, not directly compatible with the .NET Framework. Then include this assembly in your code to access COM interfaces.

Once you've done this, you need to set up the project to use the free registry DLL in the Windows interface .

There is also a second alternative from Framework 3.5, which is compiling the Interop DLL in the project build. Within your .csproj file, you need to put the following:

<Project ...>
  <ItemGroup>
    <COMFileReference Include="itaucripto.dll">
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMFileReference>
  </ItemGroup>
</Project>

More details on this SO response .

    
26.02.2015 / 21:46
0

You can reference the Dll using DllImport. At the top of your code type:

Imports System.Runtime.InteropServices

Then put the DLL in the source of your code, this is very important, if your Dll is in a folder that it can not find, it will not work. Finally, just invoke the DL.

<System.Runtime.InteropService.DllImport("SUADLL.dll", _
SetLastError:=True, CharSet:=CharSet.Auto)> _
    
31.10.2017 / 11:18