Search code examples
c#dllbuildhyperlinkmappoint

Correctly link against MapPoint DLL


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?


Solution

  • 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.