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.




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

| improve this answer | |
  • 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 – Logan B. Lehman Mar 21 '12 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 Mar 21 '12 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 Mar 21 '12 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? – Logan B. Lehman Mar 22 '12 at 4:52

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.

| improve this answer | |
  • 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 – George Silva Mar 21 '12 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 – Logan B. Lehman Mar 21 '12 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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