4

I tried using StackOverflow, but I don't think anyone can answer my question in context(ArcMap Addins).

I am currently developing an add-in that needs to load a custom control DLL as a dependency. Unfortunately, ArcMap uses DLL's as their add-ins. So in turn, I must be able to either import an embedded resource to the Visual Studio Toolbox(for use with the forms), or figure out a way to make the control reference the embedded DLL as its delegate.

Let me know if you happen to have any ideas.

Thanks,

Logan

2 Answers 2

1

In my Addin solution (in C#), I have no problem including other assemblies inside of the esriAddin file. It's automatic, at least when referencing private assemblies in your project.

Let me know specifically what problem you're facing and I'll see if I can help. JT

4
  • How exactly have you done this? I used Kirk's method, and it loaded the assembly, yet it is having a little bit of an issue. Please read here on StackOverflow for the description of my next issue: Reference to Embedded Resource Commented Mar 21, 2012 at 3:21
  • Maybe I'm not understanding the solution. What I'm referring to is, I can create a multi-project solution in VS2010, of which the main application is the esri Addin Project, which in turn uses the other assemblies from the other projects as part of its build.
    – JTran
    Commented Mar 21, 2012 at 17:17
  • (Continued from the previous comment) When I unzip the esriAddin file, i see the DLL included in the Install subfolder, and everything works. If you're talking about dynamic assemblies, then maybe that's a different problem.
    – JTran
    Commented Mar 21, 2012 at 17:24
  • Ahh, no. This has to be an embedded resource, meaning that it is a DLL within the Add-In DLL. Are we on the same page? Commented Mar 22, 2012 at 4:52
1

I think you should be able to embed a dll as a binary stream resource in the same way that this answer on stackoverflow describes embedding an mdb file.

To load the dll from a string, you should be able to use Assembly.Load to load the assembly from a byte array. You'll also need to include the dependent assemblies.

I do wonder, along with @JTran, why you need to do this in the first place though.

2
  • i've done this to allow the user to register a dynamic class extension. The user has a Dll with a class that implements a certain interface specified in my code and points to a file in his system. The base class extension then instantiates that and attempts to run all registered class extensions for that feature class. :D Commented Mar 21, 2012 at 3:10
  • Kirk, this works very well. Although now I am having an issue to where it is trying to reference both the assembly I used for setting the control, and the one I loaded via reflection. See here for the next problem: Reference to Embedded Resource Commented Mar 21, 2012 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.