Click to See Complete Forum and Search --> : conflict while loading assembly


somsally
July 16th, 2008, 02:09 AM
Hi,

I have an issue with dll reference. I use .Net 2.0 and VS 2005 on Windows 2003

I am working with 2 class library projects.

ProductLib which refers ClientBase and CoreLibrary version 1.
ClientBase too refers CoreLibrary version 1

All was fine. Then I had to upgrade ProductLib and during that time i had to update CoreLibrary version referred by ProductLib to version 2. and for some reasons I cannot upgrade the CoreLibrary version in ProductLib for now.

So now I have ProductLib referring CoreLibrary version 2 and the referenced assembly ClientBase referencing CoreLibrary version 1.

During compilation i get the error "The base class or interface 'CoreLibrary.BaseUtil' in assembly 'CoreLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7t5154a4645b8501' referenced by type 'ClientBase.FileWrapper' could not be resolved"

Also saw a warning "The dependency 'CoreLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7t5154a4645b8501'' in project 'ProductLib' cannot be copied to the run directory because it would overwrite the reference 'CoreLibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7t5154a4645b8501'"

One main change between CoreLibrary 1 and 2 is that in Ver 1 the base class name is BaseUtil and in ver 2 the base class name is BaseUtility.

How to resolve this issue ?

Below is what i tried

1. In ClientBase, in reference properties of the CoreLibrary, I selected "Specific Version" to True and refered the ClientBase in ProductLib as project reference.
2. With the same reference setting as above this time I tried binary reference (Gac'ed the ClientLib)
3. With the same setup as above (2) this time i referred the dll directly from GAC (gave the full path)

Same error in all the cases

Appreciate any suggestions

Thanks,
Som

compavalanche
July 17th, 2008, 03:42 AM
You've probably already checked this but I would go to Control Panel->Adminsitrative Tools->Microsoft .NET Framework 2.0 Configuration.

Make sure you don't have any special assembly configurations. You could also manually remove the old version if it exists.

I would also be curious to know if the same thing happens on a different machine that has never seen your software before.

somsally
July 17th, 2008, 08:52 AM
Thanks for your reply

There are no entries in Configured Assemblies. also I tried the same on different system. Wasn't able to compile...