Shared Assembly best practices?

  • Thread starter Thread starter CK
  • Start date Start date
C

CK

Good Morning All,
What the best way to use references? Reference a project in another project
or reference a DLL. We are developing C# Sharp Web Apps in VS 2003.
We are getting warnings like the following.
Warning: The dependency 'TTT.Library, Version=1.0.0.1, Culture=neutral' in
project 'Dmt' cannot be copied to the run directory because it would
overwrite the reference 'TTT.Library, Version=1.0.0.3, Culture=neutral'.
When I search for the file on my local box, I am getting several different
versions found in different projects. We were sort of taught, when building
a solution, the solution would contain several projects, we add the projects
to the solution as needed, then do project references inside each project
that may need that library. Is this a bad idea? Should we have just one
project in a solution and use GACUTIL.exe so it is available to all
projects? Does anyone have any good links deiscussing these topics? We had
thought if you make changes to a project that is referenced in other
projects, they would all keep the same versions. It doesn't seem to work
quite this way. Any feedback is always appreciated.
TIA,
~CK
 
The reason you are getting this is because you do not have a fixed assembly
version. And different DLLs are compiled with different version of this DLL

You have 3 options:

1. Ignore this error. Your assembly should be getting built anyway
2. Set the version number for the referenced DLL
3. Set CopyLocal to False in the dll reference properties

If you use the GAC, you will need to fix the assembly version, or else every
time this DLL gets recompiled, you will need to recompile everything that
references it.

I personally like to keep 1 project for every solution. This avoids any
messes or confusion.
 
Back
Top