Take the 2-minute tour ×

I have a C# application referencing the "Microsoft MapPoint 18.0 Object Library (North America)" ActiveX control library - I added this under "References" in my project.

The application builds, and I put a try/catch around the call to new MapPoint.Application(), so I would be able to detect if MapPoint is installed, and display an error-message when that part of the application is unavailable - that is, my application doesn't require MapPoint, it just has some extra functionality if MapPoint is available.

The problem is, I now have a compile-time dependency on the MapPoint binaries - the application can't build on a workstation that doesn't have MapPoint installed.

Is there a way around this?

share|improve this question
it's not a real problem, as you say, the application can't build without those binaries... but after you have built you can distribute build output and it should run. To reference those files and build against them, clearly you need these referenced files during the build :) –  Davide Piras Sep 6 '11 at 20:20
there's no way to copy a minimal subset of those files and bundle them with the binaries? or some way to extract from my workstation whatever is required to build? all it should need to build is whatever is required to link to the DLL, right? (I tried copying the TLB file from MapPoint install folder, but that does not seem to be enough...) –  mindplay.dk Sep 6 '11 at 20:25
of course there is a way, you have some entries in the references node in Visual Studio, select those, right click, properties, and set copy local to true. After you built and those files are in the build output folder copy them in a subfolder in the source tree, remove the old references and reference the files from there, check everything in the source control and now whoever does a check-out has also those files with the sources and can build. –  Davide Piras Sep 6 '11 at 20:28
Copy Local is false and grayed out. Hmmmm... –  mindplay.dk Sep 6 '11 at 20:36
add comment

1 Answer

up vote 2 down vote accepted

When you add the reference to your project, VS should be creating an interop file for you. This is all you need in order to compile, so you can put it in a shared location or your SCM tool.

share|improve this answer
I just figured that out - it works! thanks! –  mindplay.dk Sep 6 '11 at 20:46
add comment

Your Answer


