By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,816 Members | 2,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,816 IT Pros & Developers. It's quick & easy.

Referencing third party DLL's from another project

P: 81
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 : ThirdPartyDataGrid.

Now in project B, I reference Project A, and I try and use MyDataGrid, but get a compile time error saying:
Error 53 Unknown build error, 'Cannot resolve dependency to assembly 'Xceed.Wpf.DataGrid, Version=2.0.8127.13040, Culture=neutral, PublicKeyToken=ba83ff368b7563c6' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve 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!
Dec 11 '08 #1
Share this Question
Share on Google+
5 Replies

P: 61
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.
Dec 12 '08 #2

P: 81
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.
Dec 12 '08 #3

Expert 100+
P: 221
Is it just a straight reference from A to B?

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

Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
Assembly.ReflectionOnlyLoad(byte[] rawAssembly)
Assembly.ReflectionOnlyLoad(String assemblyName)
Dec 12 '08 #4

P: 81
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.Class1' is defined in an assembly that is not referenced. You must add a reference to assembly 'ClassLibrary, Version=, Culture=neutral, PublicKeyToken=null'
Dec 15 '08 #5

Expert 100+
P: 221
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?
Dec 16 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.