VB.NET 2008 - When i add a COM reference it copies it to the Obj folder

Posted on 2009-04-27
Last Modified: 2013-11-26
I'm adding an old com reference; msadox.dll (for creating a ms access database)

Like other dll's, i keep them in the project directory so that when i give the code to other people, we wont have missing dll problems.

So i copy msadox.dll to the project folder (C:\Projects\TestProject\msadox.dll), add reference, browse, select this file.

When i do this, the reference location is set to;

Its not even the same file? Whats going on? I do not want dependencies in the bin or obj folder because i delete these folders before sending the code (because it makes the zip file way smaller)
Setting copylocal to false (which is true by default when i add this reference) seems to do nothing.
Question by:tfsln
    LVL 12

    Expert Comment

    It's an interop assembly.
    Not sure if it will work as desired, however I believe there is a utility that can create a .dll from the COM assembly with the metadata:

    Perhaps you can reference the resulting .dll and do things the way you are used to.
    LVL 13

    Accepted Solution

    You shouldn't add the reference by copying this DLL. This DLL is actually a COM that is distributed with the OS ! You just have to add prerequisite on it when deploying the application.
    If you added the reference on the COM, from the COM tab, I don't think you would had any issue. Have a look to the screenshot.
    Now, it is a COM ! Then, for free, Visual Studio is nice enougth to create the RCW (Runtime Callbale Wrapper) for you :
    A COM lifes in a native world, so unmanaged. To be able to exchange data with a managed application a wrapper is needed. This wrapper is a proxy which, among other tasks, mainly handles the marshalling problems from the .Net world to the native world. This RCW is this strange file that you see : Interop.ADOX.dll. You don't need to try to deploy msadox.dll, it is already present with the OS, but this RCW will be of course deployed.
    You should also have a look to this discussion :

    Author Closing Comment

    Great, thanks!

    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

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    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…

    737 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

    21 Experts available now in Live!

    Get 1:1 Help Now