Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 878201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:44:09+00:00 2026-05-15T11:44:09+00:00

I have a .NET application written in C#. My application uses 3rd party libraries,

  • 0

I have a .NET application written in C#. My application uses 3rd party libraries, which use 3rd party libraries, which in turn rely on the existence of sqlceme35.dll (Microsoft SSCE). Somewhere along the line the dependency on sqlceme35.dll is not being accounted for, and we’ve had a number of situations where my software has been installed on a computer without this library, the application appears to run fine for most functions, but crashes in a spectacular way with cryptic error messages when we get to the point when we try to call into sqlceme35.dll.

Even though we now know what the effects look like when the library isn’t present, I would still like to be more proactive about detecting when the library is not available and giving the user a friendly error message “here is the problem, here is the solution”.

The immediate question is: How do I detect, at runtime, the presence of the sqlceme35.dll library?

The larger question is: How do I detect, at runtime, the presence of any arbitrary .dll file, whether it be a native code or a managed code library?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:44:09+00:00Added an answer on May 15, 2026 at 11:44 am

    We embed the unmanaged dlls into an assembly and then copy them out to the executing dll location (for web apps the shadow copy bin folder). This guarantees that the correct version is being run for a particular version of our app. Unfortunately this may not be doable (legal) depending on licensing terms for your various applications. In these cases, your best option is likely to use LoadLibrary to verify that the library is found, but beware of loading the wrong version (see also: DLL hell); this may or may not be a problem you can even solve (for us, the only solution was embedding the dlls and extracting them from the assemblies where needed).

    Here is our code in question for the Sybase ASE ADO drivers:

    public static class SybaseResourceExtractor {
        public static void ExtractSybaseDependencies() {
            ExtractSybaseDependency("QueryLibrary.Unmanaged.sybdrvado20.dll", "sybdrvado20.dll");
            ExtractSybaseDependency("QueryLibrary.Unmanaged.msvcr80.dll", "msvcr80.dll");
            ExtractSybaseDependency("QueryLibrary.Unmanaged.sybcsi_certicom_fips26.dll", "sybcsi_certicom_fips26.dll");
            ExtractSybaseDependency("QueryLibrary.Unmanaged.sybcsi_core26.dll", "sybcsi_core26.dll");
            ExtractSybaseDependency("QueryLibrary.Unmanaged.sbgse2.dll", "sbgse2.dll");
        }
    
        /// <summary>
        /// Extracts a resource to a file.
        /// </summary>
        /// <param name="resourceName">Name of the resource.</param>
        /// <param name="filename">The filename including absolute path.</param>
        static void ExtractSybaseDependency(string resourceName, string filename) {
            try {
                var assembly = Assembly.GetAssembly(typeof(AseConnection));
                var executingAssembly = Assembly.GetExecutingAssembly();
                filename = Path.GetDirectoryName(assembly.Location) + "\\" + filename;
    
                if (File.Exists(filename)) {
                    File.Delete(filename);    
                }
    
                if (!File.Exists(filename)) {
                    using (Stream s = executingAssembly.GetManifestResourceStream(resourceName)) {
                        using (var fs = new FileStream(filename, FileMode.Create)) {
                            if (s == null) {
                                throw new Exception("Failed to get resource stream for " + resourceName);
                            }
    
                            var b = new byte[s.Length];
                            s.Read(b, 0, b.Length);
                            fs.Write(b, 0, b.Length);
                        }
                    }
                }
            } catch {
                //Doing nothing
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.