[Last Call] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2009-04-27
Medium Priority
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

ID: 24247057
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

kaylanreilor earned 2000 total points
ID: 24543883
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 : http://msdn.microsoft.com/en-us/library/8bwh56xe.aspx.
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 : http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_20875699.html

Author Closing Comment

ID: 31575256
Great, thanks!

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Integration Management Part 2
Loops Section Overview
Suggested Courses

829 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