• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

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

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.
1 Solution
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.
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
tfslnAuthor Commented:
Great, thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now