Use c# to check dll is registered

Posted on 2007-10-07
Last Modified: 2012-08-13
I need to check programmatically through c# that a particular 3rd party dll (rda2.dll) is registered.
Can anybody tell me how?

I need to do this as otherwise a particular part of my program will crash if dll not registered.
Question by:dbdp
    LVL 23

    Expert Comment

    Enumerate the clsids under HKCR\CLSID.  For each one, the default value under InprocServer gives the path of the registered item.

    Author Comment

    Could you tell me how to do that?
    LVL 23

    Accepted Solution

    RegistryKey clsid=Registry.ClassesRoot.OpenSubKey("CLSID");
    string[] ClsIDs=clsid.GetSubKeyNames();
    string subkey="";
    for (int i=0; i<ClsIDs.Length; i++)
        if (subkey.Substring(0,1)!="{") continue;
        RegistryKey cls=Registry.ClassesRoot.OpenSubKey("CLSID\\"+subkey+"\\InprocServer32");
        if (cls==null) continue;
        string x=cls.GetValue("","").ToString();

    x is the thing to look at.  Note that it may or may not be fully qualified.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now