This issue is usually caused by using file-based references instead of
project-to-project references and not having dependencies between projects
set up correctly.  For example, if you have the following projects and
references, with each reference set to CopyLocal=True:

    * IDBAdapter
    * Project1
          References: IDBAdapter
    * Project2
          References: IDBAdapter
    * Project3
          References: Project1, Project2

Let's assume you start out with IDBAdapter == 1.0.0.0 in Project1 and
Project2.  Now, assume that you do NOT have dependencies between projects
defined, and you just happen to build in the following order:

        IDBAdapter
        Project1
        Project3
        Project2

Here is what will happen:

* Step 1:  build IDBAdapter.  Version number is updated to, say,
           1.0.2.0.
* Step 2:  build Project1.  The IDBAdapter copy in Project1 is
           updated to 1.0.2.0 since the project system will update
           all CopyLocal references before the build.
* Step 3:  build Project3.  The project system brings in dependencies
           as follows:

       - Project1 brings in itself and IDBAdapter 1.0.2.0
         - Project2 brings in itself adn IDBAdapter 1.0.0.0
                  (IDBAdapter is still version 1.0.0.0 because Project2
                  hasn't been built yet)

Since now Project3 has two different versions of IDBAdapter that need to
be copied to the output directory, Visual Studio .NET generates an error
message.

You should be able to solve this by manually setting up project
dependencies such that the build order is IDBAdapter, Project1, Project2,
and then Project3.  You can do this by right-clicking on each project and
selecting "Project Dependencies".  Note that Visual Studio will set up
dependencies for you automatically if you use project-to-project
references instead of file references.

Izzy Gryko
Visual Basic Development
Microsoft Corporation

** This posting is provided "AS IS" with no warranties, and confers no
rights. **

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to