Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

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

share|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 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 Lehman Mar 22 '12 at 4:52
add comment

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.

share|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 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 Lehman Mar 21 '12 at 3:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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