By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

File/Project References within Solutions

P: n/a
This is regarding Visual Studio 2003 (framework 1.1). We have several
projects/libraries. Of course, many of these reference each other. If we
only had one solution, we would simply add all of the libraries that we wish
to debug to the solution, and make project references to the other projects
within the solution. All other library references would be file references,
since they were not included in the solution.

However, the problem comes in when you have more than one solution sharing
different libraries. For example, take the following simplified setup:

Solution1
- Project1
- Project2
Project1 (project reference) - Solution1TestClient

Solution2
- Project2 Project1 (file reference) - Project3 Project2 (project reference)

- Solution2TestClient

If the code (and project information) is being shared, then we obviously
can't have different reference types for Project2. Therefore, we are left
with either a) removing Project1 from Solution1, and making the Project1
reference in Project2 a file reference, or b) adding Project1 to Solution2,
and making the Project1 reference in Project2 a project reference. Of
course, this is an over-simplified example, and our situation is much more
complicated and will only get worse. But if I could find a solution to this
simple example, we should be able to apply it to our more complicated setup.

Now, you may be asking why we would want two different developers working on
Project2 code, but the point of including a project in a solution is not
always to be able to make modifications to it, but to have quick access to
the code for viewing. Also, there are cases where developers may be
assigned to different classes (files) within a project, and work may be
shared within a project, but by developers that are working on two different
solutions.

Is there not a way to tell visual studio to reference a project, and if it
detected that the project is not loaded, simply "auto-switch" the reference
to the file (or vice-versa, it would reference the compiled file, and detect
when the project was loaded and switch to a project reference)? This seemed
to work in VB6, where if would detect when a project is loaded, and change
the reference to the loaded project instead of the compiled file.

If this is not possible, then what workarounds have you guys implemented to
resolve this issue?

Thanks in advance for your help.

Jerad
Mar 24 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I don't really understand your issue. It's a long post, and I'm really
confused as to what you are trying to do.

I'm not sure how multiple people are conflicting with each other. Everyone
has their own copy of the code, the projects, the solutions - why is this a
problem?

"Jerad Rose" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
This is regarding Visual Studio 2003 (framework 1.1). We have several
projects/libraries. Of course, many of these reference each other. If we
only had one solution, we would simply add all of the libraries that we
wish
to debug to the solution, and make project references to the other
projects
within the solution. All other library references would be file
references,
since they were not included in the solution.

However, the problem comes in when you have more than one solution sharing
different libraries. For example, take the following simplified setup:

Solution1
- Project1
- Project2
> Project1 (project reference)

- Solution1TestClient

Solution2
- Project2
> Project1 (file reference)

- Project3
> Project2 (project reference)

- Solution2TestClient

If the code (and project information) is being shared, then we obviously
can't have different reference types for Project2. Therefore, we are left
with either a) removing Project1 from Solution1, and making the Project1
reference in Project2 a file reference, or b) adding Project1 to
Solution2,
and making the Project1 reference in Project2 a project reference. Of
course, this is an over-simplified example, and our situation is much more
complicated and will only get worse. But if I could find a solution to
this
simple example, we should be able to apply it to our more complicated
setup.

Now, you may be asking why we would want two different developers working
on
Project2 code, but the point of including a project in a solution is not
always to be able to make modifications to it, but to have quick access to
the code for viewing. Also, there are cases where developers may be
assigned to different classes (files) within a project, and work may be
shared within a project, but by developers that are working on two
different
solutions.

Is there not a way to tell visual studio to reference a project, and if it
detected that the project is not loaded, simply "auto-switch" the
reference
to the file (or vice-versa, it would reference the compiled file, and
detect
when the project was loaded and switch to a project reference)? This
seemed
to work in VB6, where if would detect when a project is loaded, and change
the reference to the loaded project instead of the compiled file.

If this is not possible, then what workarounds have you guys implemented
to
resolve this issue?

Thanks in advance for your help.

Jerad

Mar 24 '06 #2

P: n/a
Thanks for the follow-up, Marina. I'll try to explain the exact issue.

It basically boils down to having to keep changing the reference type on a
project between a file reference and a project reference, because Visual
Studio is not smart enough to be able to make a generic reference to a
project and its binaries. We have to explicitly set it as either file OR
project reference.

And here's the problem with that:

Using the example setup in my original post, if my solution contains
Project2 but not Project1, then Project2's reference to Project1 needs to
point to Project1's DLL (file reference). If my teammate's solution
contains both Project1 and Project2, he then has to check out and change
Project2 so that its reference to Project1 points to Project1's project
(project reference). Then, if I need to get his latest changes to Project2,
I then have to check it out again and change the reference to Project1
*back* to a file reference.

But our situation is much worse, because our solutions contain several
common projects, but my solution doesn't include many dependent projects
that his solution does include -- so I have to do the above for several
files.

For now, I have resorted to just including every project in my solution that
his solution includes, but this should not be necessary and is not
practical -- especially if we were to grow to where our enterprise has
several different solutions, with them each containing/not containing shared
projects.

Hope that explains it. If not, feel free to follow up with questions and I
will try and clarify.

Thanks again for your help.

Jerad

"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:e6**************@TK2MSFTNGP12.phx.gbl...
I don't really understand your issue. It's a long post, and I'm really
confused as to what you are trying to do.

I'm not sure how multiple people are conflicting with each other. Everyone
has their own copy of the code, the projects, the solutions - why is this a problem?

"Jerad Rose" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
This is regarding Visual Studio 2003 (framework 1.1). We have several
projects/libraries. Of course, many of these reference each other. If we only had one solution, we would simply add all of the libraries that we
wish
to debug to the solution, and make project references to the other
projects
within the solution. All other library references would be file
references,
since they were not included in the solution.

However, the problem comes in when you have more than one solution sharing different libraries. For example, take the following simplified setup:

Solution1
- Project1
- Project2
> Project1 (project reference)

- Solution1TestClient

Solution2
- Project2
> Project1 (file reference)

- Project3
> Project2 (project reference)

- Solution2TestClient

If the code (and project information) is being shared, then we obviously
can't have different reference types for Project2. Therefore, we are left with either a) removing Project1 from Solution1, and making the Project1
reference in Project2 a file reference, or b) adding Project1 to
Solution2,
and making the Project1 reference in Project2 a project reference. Of
course, this is an over-simplified example, and our situation is much more complicated and will only get worse. But if I could find a solution to
this
simple example, we should be able to apply it to our more complicated
setup.

Now, you may be asking why we would want two different developers working on
Project2 code, but the point of including a project in a solution is not
always to be able to make modifications to it, but to have quick access to the code for viewing. Also, there are cases where developers may be
assigned to different classes (files) within a project, and work may be
shared within a project, but by developers that are working on two
different
solutions.

Is there not a way to tell visual studio to reference a project, and if it detected that the project is not loaded, simply "auto-switch" the
reference
to the file (or vice-versa, it would reference the compiled file, and
detect
when the project was loaded and switch to a project reference)? This
seemed
to work in VB6, where if would detect when a project is loaded, and change the reference to the loaded project instead of the compiled file.

If this is not possible, then what workarounds have you guys implemented
to
resolve this issue?

Thanks in advance for your help.

Jerad


Mar 24 '06 #3

P: n/a
I don't see why he has to change the reference to a project reference? Why
can't it always be a file reference?

All my solutions and projects are always 1 to 1, so I never have these
issues...

If there is no way to make it work, then the easiest way to solve this is
ask people to have one solution per project. It's really not that big a
deal - are they really making changes to 5 different projects at once? And
if you need more then one open, you can use multiple IDE windows.

But again, I'm not sure why you can't just stick to file references.

"Jerad Rose" <no@spam.com> wrote in message
news:u6****************@TK2MSFTNGP14.phx.gbl...
Thanks for the follow-up, Marina. I'll try to explain the exact issue.

It basically boils down to having to keep changing the reference type on a
project between a file reference and a project reference, because Visual
Studio is not smart enough to be able to make a generic reference to a
project and its binaries. We have to explicitly set it as either file OR
project reference.

And here's the problem with that:

Using the example setup in my original post, if my solution contains
Project2 but not Project1, then Project2's reference to Project1 needs to
point to Project1's DLL (file reference). If my teammate's solution
contains both Project1 and Project2, he then has to check out and change
Project2 so that its reference to Project1 points to Project1's project
(project reference). Then, if I need to get his latest changes to
Project2,
I then have to check it out again and change the reference to Project1
*back* to a file reference.

But our situation is much worse, because our solutions contain several
common projects, but my solution doesn't include many dependent projects
that his solution does include -- so I have to do the above for several
files.

For now, I have resorted to just including every project in my solution
that
his solution includes, but this should not be necessary and is not
practical -- especially if we were to grow to where our enterprise has
several different solutions, with them each containing/not containing
shared
projects.

Hope that explains it. If not, feel free to follow up with questions and
I
will try and clarify.

Thanks again for your help.

Jerad

"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:e6**************@TK2MSFTNGP12.phx.gbl...
I don't really understand your issue. It's a long post, and I'm really
confused as to what you are trying to do.

I'm not sure how multiple people are conflicting with each other.
Everyone
has their own copy of the code, the projects, the solutions - why is this

a
problem?

"Jerad Rose" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> This is regarding Visual Studio 2003 (framework 1.1). We have several
> projects/libraries. Of course, many of these reference each other. If we > only had one solution, we would simply add all of the libraries that we
> wish
> to debug to the solution, and make project references to the other
> projects
> within the solution. All other library references would be file
> references,
> since they were not included in the solution.
>
> However, the problem comes in when you have more than one solution sharing > different libraries. For example, take the following simplified setup:
>
> Solution1
> - Project1
> - Project2
> > Project1 (project reference)
> - Solution1TestClient
>
> Solution2
> - Project2
> > Project1 (file reference)
> - Project3
> > Project2 (project reference)
> - Solution2TestClient
>
> If the code (and project information) is being shared, then we
> obviously
> can't have different reference types for Project2. Therefore, we are left > with either a) removing Project1 from Solution1, and making the
> Project1
> reference in Project2 a file reference, or b) adding Project1 to
> Solution2,
> and making the Project1 reference in Project2 a project reference. Of
> course, this is an over-simplified example, and our situation is much more > complicated and will only get worse. But if I could find a solution to
> this
> simple example, we should be able to apply it to our more complicated
> setup.
>
> Now, you may be asking why we would want two different developers working > on
> Project2 code, but the point of including a project in a solution is
> not
> always to be able to make modifications to it, but to have quick access to > the code for viewing. Also, there are cases where developers may be
> assigned to different classes (files) within a project, and work may be
> shared within a project, but by developers that are working on two
> different
> solutions.
>
> Is there not a way to tell visual studio to reference a project, and if it > detected that the project is not loaded, simply "auto-switch" the
> reference
> to the file (or vice-versa, it would reference the compiled file, and
> detect
> when the project was loaded and switch to a project reference)? This
> seemed
> to work in VB6, where if would detect when a project is loaded, and change > the reference to the loaded project instead of the compiled file.
>
> If this is not possible, then what workarounds have you guys
> implemented
> to
> resolve this issue?
>
> Thanks in advance for your help.
>
> Jerad
>
>



Mar 24 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.