Multiple references in the same project.

S

sonu

Hi all,


I have developed an application in which there are uptill now 12
projects and few of them are
dependent on each other.

The problem is I am not able to manage the references across different
projects.

Previously I used to get one error it says something like the object of
type cannot be
conveted to the other object but in actual case those objects were of
same type.
Somehow I could able to resolve that problem.

Now the scenario is different now I am getting few warnings like the
'specified dependency
could not be copied because it will overwrite the reference with some
version no. associated
with it'.

And there is one constant problem of the reference path of the DLL's
getting changed constantly even though I specify a proper path for the
referenced dll on recompliation of
the parent project the path of the referenced dll is getting changed
automatically.

I don't know why such a problem is happening is there any help which I
can use to manage
my references throughout the life of my project.
 
A

Armin Zingler

sonu said:
Hi all,


I have developed an application in which there are uptill now 12
projects and few of them are
dependent on each other.

The problem is I am not able to manage the references across
different projects.

Previously I used to get one error it says something like the object
of type cannot be
conveted to the other object but in actual case those objects were
of same type.
Somehow I could able to resolve that problem.

Now the scenario is different now I am getting few warnings like the
'specified dependency
could not be copied because it will overwrite the reference with
some version no. associated
with it'.

The only thing I can say about it:

- Assume you have projects A, B and C.
- A is an Exe, B and C are libraries.
- A references B and C. B references C.

Whenever you compile project C - the project at the lowest layer - you also
have to compile project B even though you didn't change anything within.
This helped me getting rid of 'specified dependency could not be copied...'
message. If you don't compile B, the assembly B.dll still references (in
it's meta information) version 1 of C.dll whereas project A references
version 2. This creates the conflict and the message.

And there is one constant problem of the reference path of the DLL's
getting changed constantly even though I specify a proper path for
the referenced dll on recompliation of
the parent project the path of the referenced dll is getting changed
automatically.

I don't know why such a problem is happening is there any help which
I can use to manage
my references throughout the life of my project.

Sorry, can't help you with this.



Armin
 
C

Chris Dunaway

In addition to Armin's comments, in your AssemblyInfo.vb file for each
project, make sure you specify the full version number for the
assembly. Don't rely on the 1.0.*.* notation to automatically bump the
version on each compile. Doing so can cause conflicts like the one you
see.

See Jeffrey Richter's book, "Applied Microsoft .Net Framework
Programming" from Microsoft Press. He explains in detail about
versioning and why relying on the auto version increment causes
problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top