Referencing third party DLL's from another project

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nelsonbrodyk
    New Member
    • Mar 2008
    • 81

    Referencing third party DLL's from another project

    Hey All,
    I have two projects, A and B.

    Inside Project A, I have a DataGrid class, that extends a third party libraries datagrid.

    So the class looks like:

    public class MyDataGrid : ThirdPartyDataG rid.


    Now in project B, I reference Project A, and I try and use MyDataGrid, but get a compile time error saying:
    Originally posted by error message
    Error 53 Unknown build error, 'Cannot resolve dependency to assembly 'Xceed.Wpf.Data Grid, Version=2.0.812 7.13040, Culture=neutral , PublicKeyToken= ba83ff368b7563c 6' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyA ssemblyResolve event.
    Now if Project B references the Xceed (thirdParty) datagrid, then it works.

    Is there a way that B can just reference A? I would hate to have all other projects that want to use my datagrid to have to actually have a copy and a reference to the dll!

    Thanks for your time!
  • Ramk
    New Member
    • Nov 2008
    • 61

    #2
    Right click on the reference you added(in your case, in project A for the 3party dll & in project B for the reference project A), Choose Properties & then set the
    Copy Local property to True. Afterwards, whenever you build your project, VS will automatically copies the referred assemblies to the output folder.

    Comment

    • nelsonbrodyk
      New Member
      • Mar 2008
      • 81

      #3
      Yes, but that still doesn't seem to solve the issue. It seems to force me to have Project B have a reference to Project A and to the third party dll. I was hoping to only need a dependency to project A.

      Comment

      • nukefusion
        Recognized Expert New Member
        • Mar 2008
        • 221

        #4
        Is it just a straight reference from A to B?

        You're not using any of the following methods in your code?

        Assembly.Reflec tionOnlyLoadFro m(String assemblyFile)
        Assembly.Reflec tionOnlyLoad(by te[] rawAssembly)
        Assembly.Reflec tionOnlyLoad(St ring assemblyName)

        Comment

        • nelsonbrodyk
          New Member
          • Mar 2008
          • 81

          #5
          No I'm not using any of those. My UI.exe just references another project that outputs a .dll. The .dll uses the other third party .dll, but when the .exe project wants to use my wrapped object from my .dll, it still wants the third party .dll.

          Note: When I removed the code from XAML and did it in the code behind, the error message actually changed slightly. It gives me something similar to this:

          Error 1 The type 'ClassLibrary.C lass1' is defined in an assembly that is not referenced. You must add a reference to assembly 'ClassLibrary, Version=1.0.0.0 , Culture=neutral , PublicKeyToken= null'

          Comment

          • nukefusion
            Recognized Expert New Member
            • Mar 2008
            • 221

            #6
            Sounds strange. I found a reference to the same problem in the Xceed forums, posted about a year ago. As of yet that post doesn't have an answer either, so I don't know if this is caused by the Xceed grid or another issue. Maybe someone else can shed some light on this one?

            Comment

            Working...