Welcome, Guest
Username: Password: Remember me
Welcome to the XSharp forum!

Tell us and our members who you are, what you like and why you became a member of this site.
We welcome all new members and hope to see you around a lot!
  • Page:
  • 1

TOPIC:

Unable to load DLL 'ace32.dll': The specified module is not found. 27 Dec 2021 18:22 #20896

  • thilef
  • thilef's Avatar
  • Topic Author


  • Posts: 8
  • Hi all,

    I try to use some of the ADS X# functions. For example : AdsMgConnect().
    An error message occurs at runtime when calling the function :
    Unable to load DLL 'ace32.dll': The specified module is not found (Exception de HRESULT : 0x8007007E)

    All the ADS dll (ace32, axcws32, etc.. v8.10) are present in the application folder.

    The startup application is a C# webservice calling the X# librairy.

    Am I missing something in the references or in the properties of the librairy ?
    There is no previous call to some other ADS function before AdsMgConnect(), neither dbf opening..
    Is there something to call before ?

    Similar code was working correctly in Vulcan calling the Ace32.dll directly, prototyping the functions with _DLL FUNC, PSZ and VOSTRUCT parameters, like in VO.
    I tried like this in X#, but an System.AccessViolationException : 'Try to read or write protected memory". occurs converting using Strin2Psz() functions.

    Thanks for help,

    Thierry

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 27 Dec 2021 21:10 #20898

    • robert
    • robert's Avatar


  • Posts: 3599
  • Thierry,

    The ADS functions in the XSharp.RDD.DLL do not expect PSZ values. You can send in "normal" .Net strings. We take care of the conversion to the Ansi strings internally.

    Can you show the code from which you are calling the function ?
    And is your Webserver running in 32 bits or 64 bits mode ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 11:43 #20901

    • ic2
    • ic2's Avatar


  • Posts: 1667
  • Hello Thierry,

    Do you use
    ACE.AdsMgConnect

    (See devzone.advantagedatabase.com/dz/webhelp...c11/adsmgconnect.htm)

    You also might want to read this, some ADS methods are not available in the X# runtime, Chris wrote there how to accesss these.

    www.xsharp.eu/forum/public-product/2442-...s-with-x-dll-s#17922

    Dick

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 12:23 #20902

    • thilef
    • thilef's Avatar
    • Topic Author


  • Posts: 8
  • Robert,

    Thanks for your answer.
    I saw that strings are now expected in X# rather than psz in VO. My remark about psz was about additional tests I did to deal directly with Ace32.dll with my own Ads functions, not those from X#.

    The application is running in 32 bits. I sent you a small solution with only few lines of code in 2 projects to reproduce the problem. The webservice has only one method returning some environment informations and the error message catched when calling the X# AdsMgConnect() in the X# project.

    Thanks again,

    Thierry

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 12:29 #20903

    • thilef
    • thilef's Avatar
    • Topic Author


  • Posts: 8
  • Hi Dick,

    Thanks for your help.
    The AdsMgConnect() method is available in the XSharp.rdd module. My project compiles without any error. The problem occurs at runtime and the message show that ace32.dll was not found, even if the file is present in the application folder.

    Thierry

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 13:08 #20904

    • robert
    • robert's Avatar


  • Posts: 3599
  • Thierry,

    When I run your test in the debugger then the call to the AdsMgConnect works and returns the number 5033.
    That correspondents to the error message "Error 5033: No connected server was found for the given drive letter."

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 13:47 #20905

    • thilef
    • thilef's Avatar
    • Topic Author


  • Posts: 8
  • Robert,

    Thanks for your test.
    It works also for me when I copy ace32.dll in a search path, for example c:\Windows.
    As if X# was not looking the dll in the application folder..

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 14:08 #20906

    • robert
    • robert's Avatar


  • Posts: 3599
  • Thierry,

    You will have to have the ace32.dll and the other support dlls in the search path or in the folder where the webservice runs.
    X# does nothing special w.r.t. the ace32.dll.
    It has marked the function calls as an imported native functions from a native dll and that is it.
    The rest is handled by the .Net framework.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 18:02 #20910

    • thilef
    • thilef's Avatar
    • Topic Author


  • Posts: 8
  • Robert,

    This is very strange. The ace32.dll is present in the folder where the webservice runs. In the result of the webmethod, you can see the AppPath property which is the folder returns by : Path.GetDirectoryName(Assembly.GetAssembly(typeof(WebServiceTest)).CodeBase).
    Then the property IsAce32dll returning if the ace32.dll is present in this folder (File.Exists(...)).

    By digging a little more, it seems that the XSharp.rdd.dll referenced on the project is loaded from the GAC folder :
    c:\Windows\Microsoft.NET\assembly\GAC_MSIL\XSharp.Rdd\v4.0_2.6.0.0__ed555a0467764586\)
    but not from the folder where the webservice is run, despite the "CopyToLocal=True" in the Reference properties.

    When the ADS dll is copied in the XSharp.rdd.dll GAC folder, the problem disapears.

    As I have a workaround with a search path, I will be able to go further in my development. Hope the same problem will not appear in the release version.

    Thanks again for your help,

    Thierry

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 18:23 #20911

    • robert
    • robert's Avatar


  • Posts: 3599
  • XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 21:06 #20913

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Thierry,

    Based on what you are saying about the GAC, may be you can try to uninstall X#, then in the installation wizard, Select Components dialog, make sure the Register runtime DLLs in the GAC is not checked.

    HTH,
    Jamal

    Please Log in or Create an account to join the conversation.

    Last edit: by Jamal.

    Unable to load DLL 'ace32.dll': The specified module is not found. 28 Dec 2021 23:02 #20915

    • robert
    • robert's Avatar


  • Posts: 3599
  • Jamal,
    An easier and quicker solution is to navigate to the Windows\Microsoft.Net\Assemblies \GAC_Msil folder, find the XSHarp.Core, XSHarp.RDD etc folders and delete these. Also VOSystemClasses.
    The Gac_32 folder also has several VOxxxClasses folders and the VOWIn32ApiLibrary folder
    The only disadvantage of that is that you have to make sure that XSHarp.RDD, XSharp,Macrocompiler etc are in the app folder.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 29 Dec 2021 11:00 #20919

    • thilef
    • thilef's Avatar
    • Topic Author


  • Posts: 8
  • Hi Robert & Jamal,

    Indeed, deleting the XSharp folders in the GAC solves the problem, and all the .dll are now loaded from the local folder where the application is run.

    Thanks again,

    Thierry

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 29 Dec 2021 12:43 #20920

    • ic2
    • ic2's Avatar


  • Posts: 1667
  • I wrote this before: the GAC is not a good idea.

    It's good that you have an option to do without.

    I would change "Register runtime DLLs in the GAC (recommened !) in the install to

    (not recommended!!!)

    Dick

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 29 Dec 2021 13:22 #20921

    • Chris
    • Chris's Avatar


  • Posts: 3981
  • Hi Dick,

    If you do not use the GAC and you have one hundred (test or real) apps, than you need to have the runtime dlls one hundred times and update them in every one of those folders every single time the runtime is updated and you need to use the latest fixes. And this can of course easily become a nightmare to maintain.

    The GAC is fine and very helpful, as long as you keep in mind that it always gets priority over dlls in locals folders.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 29 Dec 2021 14:38 #20924

    • FFF
    • FFF's Avatar


  • Posts: 1419
  • Chris wrote: that it always gets priority over dlls in locals folders.

    One wonders, why they didn't do it the other way round. Look for dlls in startup folder, if not found, look into search path, if not found, in GAC.
    Regards
    Karl (X# 2.15.0.3; Xide 2.15; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Last edit: by FFF.

    Unable to load DLL 'ace32.dll': The specified module is not found. 29 Dec 2021 15:59 #20925

    • Chris
    • Chris's Avatar


  • Posts: 3981
  • FFF wrote:

    Chris wrote: that it always gets priority over dlls in locals folders.

    One wonders, why they didn't do it the other way round. Look for dlls in startup folder, if not found, look into search path, if not found, in GAC.


    I do wonder the same thing...
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Unable to load DLL 'ace32.dll': The specified module is not found. 29 Dec 2021 16:54 #20926

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • All,

    Check the following article that may come handy which discusses:

    Resolve assembly loads

    docs.microsoft.com/en-us/dotnet/standard/assembly/resolve-loads

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1