none
System.DllNotFoundException: Unable to load DLL 'sybdrvado11.dll': Access is denied.

    Question

  • I have an issue, i am trying to connect to sybase using aseclient, when i run it on my system, it works fine, but when i deploy on my server (Windows Server 2008) i get the following error "System.DllNotFoundException: Unable to load DLL 'sybdrvado11.dll': Access is denied." i have granted user access rights to everyone, Iusr with read, write , list folders. infact i went ahead and gave full control, but i still get the same error. please help
    Thursday, June 26, 2014 1:39 PM

Answers

  • Thank you everyone i have found the solution. for someone having the same issue i went to IIS manager , to the application pool am using for my application and changed the identity under PROCESS MODEL to Local system. that worked for me
    • Marked as answer by chikorr Thursday, June 26, 2014 4:15 PM
    Thursday, June 26, 2014 4:15 PM

All replies

  • One thing to look at is your app pool on IIS for that application.  Is this a 32-bit DLL? If so, you need to allow 32-bit DLLs in your app pool.

    Also was it installed in the GAC of your server?

    Thursday, June 26, 2014 1:53 PM
  • 1). The option to enable 32 bit application is not available i guess its because my server is a 32 bit system

    2). how will i know if it is a 32 bit dll (Ie. because really i dont know).

    3). I dont know how to install it in the GAC of the server.

    Please help me i have been on this for almost almost two weeks

    Thursday, June 26, 2014 2:00 PM
  • Access denied is a permissions issue.  Use ProcMon or equivalent and monitor the file request.  It should show the attempted open and the access that is being requested.  Ensure that whatever identity the app pool is using has permissions to the folder and file.  I find that using the Effective Access tab on Advanced Security to be very useful for determining the rights a particular user has.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Thursday, June 26, 2014 2:47 PM
    Moderator
  • Thank you @Michael Taylor and @Charles i have used the procmon, its result on Sybdrvado.dll is sucess but yet i still get the access denied error, and its driving me crazy

    6/26/2014 4:24:47 PM: System.TypeInitializationException: The type initializer for 'Sybase.Data.AseClient.AseConnection' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'sybdrvado11.dll': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
       at Sybase.Data.AseClient.Unmanaged.AseGetDriverVersion(StringBuilder value, Int32 capacity)
       at Sybase.Data.AseClient.AseConnection.CheckVersion()
       at Sybase.Data.AseClient.AseConnection..cctor()
       --- End of inner exception stack trace ---
       at Sybase.Data.AseClient.AseConnection..ctor(String connectionString)
       at Common.oleds(String SqlString, String constring)
    6/26/2014 4:24:47 PM: System.InvalidOperationException: Nullable object must have a value.
       at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
       at System.Nullable`1.get_Value()
       at Operation_FXPurchase.validate_account()

    

    Thursday, June 26, 2014 3:38 PM
  • Did you use procmon and verify the path of the file it was trying to load matched the path you had modified the security for?  Does this DLL have any dependencies that might also have a security issue?  If you applied the security to the entire folder then this is unlikely.

    Have you confirmed the account that the process is running under and that it isn't locked down?  Are you running the app locally and not from a partial trust location?

    Thursday, June 26, 2014 3:46 PM
    Moderator
  • I still maintain it's worth looking at the app pool.

    Pull up IIS Manager and locate the application you are trying to access the database.

    Right-click the application and select Advanced Settings (this will show you which app pool you're using)

    Then in Application Pools under your Web Site in IIS select your Application Pool

    Right-click and Advanced Settings...

    This will tell if you are enabling 32 bit applications, your process identity, and a gamut of other configuration settings.

    Thursday, June 26, 2014 3:52 PM
  • This could indeed be the issue if the permissions were applied to the 32-bit path of the DLL but the app pool is running as x64, or vice versa.  Looking at the actual path using procmon would clarify whether this is the issue or not.
    Thursday, June 26, 2014 4:11 PM
    Moderator
  • Also it might be worthwhile to see what you have in GAC.

    I believe for .NET versions 4 and up, it's located at c:\windows\microsoft.net\assembly

    You will then see subfolders for GAC_32, GAC_64, GAC_MSIL.  There you will see DLLs, publisher policy files, etc. This DLL should be in one of those folders.

    Thursday, June 26, 2014 4:15 PM
  • Thank you everyone i have found the solution. for someone having the same issue i went to IIS manager , to the application pool am using for my application and changed the identity under PROCESS MODEL to Local system. that worked for me
    • Marked as answer by chikorr Thursday, June 26, 2014 4:15 PM
    Thursday, June 26, 2014 4:15 PM
  • Professionally, I think it's a very bad idea to use the Local System account as your app pool identity.  This is a security vulnerability because you've just increased the attack surface of your app.  This account has too high permissions and much damage could occur if a hacker intervened.
    Friday, June 27, 2014 3:00 AM
  • Agreed, app pools should generally run under AppPoolIdentity or a service account created for app pools.  Setting the app pool to SYSTEM works around the issue but doesn't solve it.
    Friday, June 27, 2014 1:55 PM
    Moderator