Jump to content

System.DllNotFoundException Unable to load DLL 'AutoItX3.dll


VCB
 Share

Go to solution Solved by TheXman,

Recommended Posts

Hello,

Using AutoItX with c# on Visual Studio 2019, .Net Framework 4.7.2, Windows 10.

Got this error message while trying to run:

System.DllNotFoundException
  HResult=0x80131524
  Message=Unable to load DLL 'AutoItX3.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
  Source=AutoItX3.Assembly

The dll files 'AutoItX3.Assembly.dll' and 'AutoItX3.Assembly.xml' are added in the project.

What could be going wrong ?

using.PNG

Referances.PNG

DebugFolder.PNG

Link to comment
Share on other sites

  • Solution
6 hours ago, VCB said:
Message=Unable to load DLL 'AutoItX3.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

The error message is telling you exactly what the problem is, your application cannot find "AutoItX3.dll".  You appear to have overlooked/omitted the last bullet in the "AutoItX > .Net Interface > Using the .NET Interface" topic in the Help File. 

20230622_120508_AutoItXHelp.png.6bf608654f7735e324965c1149698ac7.png

It clearly states that you need to distribute those files with your executable.  Adding the reference to the AutoItX3 assembly, and "using" it, automatically includes that file in the output folder.  To automatically include the other 2 DLL files in the output folder, you can add them to your project as "existing items" and set their properties to have them copied to the output folder.  Otherwise, you can just manually copy the files the output folder.

image.png.d4f881b25133b119068afbb8ac3b5903.png

Output (bin\debug) Folder:

image.png.416e0d2bff1e838502fac2dc98ee002e.png

Edited by TheXman
Link to comment
Share on other sites

Hello,

@TheXman, OK, copied the AutoItX3.dll and AutoItX3_x64.dll files in the output folder, now things are working !

Seems that the AutoItX3.dll and AutoItX3_x64.dll files need to be in the output folder, just to run the code.

Thanks  for the heads-up !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...