Chocolade Posted July 5, 2015 Share Posted July 5, 2015 The code in form1 Is not matter.What I did was in a command prompt window registering the dll file AutoItX3.dll using regsrv32Then I added to my csharp project the dll file as reference.So now in my project I have in the references also: AutoItX3LibNow I had to change the AutoItX3Lib property Embed Interop Types from true to false.Then I worked with the AutoIt in my form1 code for few hours no problems.But then without a warning about 2 hours ago I got this error in my csharp project: Error 1 Could not resolve COM reference "f8937e53-d444-4e71-9275-35b64210cc3b" version 1.0. The specified image file did not contain a resource section. (Exception from HRESULT: 0x80070714) UsingAutoItI couldn't find about it anything in google.I fixed it now by changing this property Embed Interop Types to true then to false again and now the error is gone.This is not a solution and I can't figure out why I got this error ? Will it be back later sometime again ? What cause the error ? Link to comment Share on other sites More sharing options...
Chocolade Posted July 5, 2015 Author Share Posted July 5, 2015 Maybe there is another way to add the dll file to my project as reference without register it first with regsrv32 ?Maybe registering to the dll file with regsrv32 can make problems ?Without registering the dll file I couldn't add it as reference in my csharp project. Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 5, 2015 Administrators Share Posted July 5, 2015 (edited) You don't need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. Sounds like you are configuring the c# program to use the COM interface directly rather than the assembly version. From the docs:Using the Assembly from VB/C# within in Visual Studio is very easy:- Add a reference to AutoItX3.Assembly.dll to your project- Add a using AutoIt; statement in the files you want to use AutoIt functions- Write code like this C# example: using AutoIt; ... // Wow, this is C#! AutoItX.Run("notepad.exe"); AutoItX.WinWaitActive("Untitled"); AutoItX.Send("I'm in notepad"); IntPtr winHandle = AutoItX.WinGetHandle("Untitled"); AutoItX.WinKill(winHandle);- Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll. Edited July 5, 2015 by Jon Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Chocolade Posted July 5, 2015 Author Share Posted July 5, 2015 Thanks Jon working perfect. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now