Build order issues?

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hi there,

I have a solution which consists of 2 class libraries and 2 executables
which both consume these class libraries. I've set the correct dependencies
in order for the VS to automatically set the build order but I am still
getting issues.

On the first build every project builds in order and I recieve two error
messages briefly at the end of the build which then vanish, the error
messages are basically telling me that a value of type "foobar" cannot be
converted to type "foobar", go figure?

The second build I recieve the same two error messages which vanish, but
then I get another saying that one of my class library dll is in use
elsewhere.

The third build completely breaks everything as the projects consuming
the dll that is in use fail to resolve their dependencies.

Any ideas what is going wrong here?? I'm using VS.NET 2003, all of the
projects in question are VB.NET.

Cheers in advance!
 
Hi again,

My problem appears to be a little deeper than first expected,

[classlibrary A] --> [classlibrary B] --> [application A]
[classlibrary A] --> [classlibrary B] --> [application B]

When compiling application B, I am being told that it cannot type cast
an object for a parameter within a method within classlibrary B. The type
of the object it cannot type case is declared in classlibrary A.

Value of type 'classlibraryA.foobar' cannot be converted to
'classlibraryA.foobar'.
^This error is pointing to an object in classlibrary B.

All I can presume is that the IDE has created 2 different versions of
classlibrary A in order for it to think that the objects are of a different
type. Although this doesn't really make sense because if I examine the
references they check out to all have the correct versions.

Any ideas what's happening? Thanks loads in advance!!!

Nick.
 
Where is the code for the foobar class? You don't have multiple copies
of that code in your projects do you? Also are your references project
references or are you directly referencing the .dll files? Project
references are preferred. It sounds as if you have multiple copies of
the ClassLibraryA. Also, make sure you don't have any circular
references.

Chris
 
Hi there,
Where is the code for the foobar class? You don't have multiple copies
of that code in your projects do you? Also are your references project
references or are you directly referencing the .dll files? Project
references are preferred. It sounds as if you have multiple copies of
the ClassLibraryA. Also, make sure you don't have any circular
references.

This is getting more complex to explain by the moment. It seems to be
when I'm cross referencing (if that's the correct term), for example,

* foobar defined in "class library A"
* "class library B" defines an object "foofoo" which consumes "foobar"
* "application B" defines an object "barfoo" which consumes "foobar".
* When "barfoo"'s "foobar" property is set by a reference to from an
instance of "foofoo" all goes pear shaped.

Confusing?

I don't think I have any circular references, and certainly only one
definition of "foobar".

Nick.
 
Right I've fixed it!

I moved the reference of "foobar" from "class library B", and it fixed the
issue!

Nick.
 
Back
Top