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

How to force reference update?

P: n/a
Hi all,

I'm trying to handle two projects in one solution (.net 2002, both projects
are VB). The first project contains only some public constant definitions
(for the moment) and compiles into class libarary. The second one is builds
an executable which has a reference to the assembly of the first project to
retrieve global constant definitions. The whole thing works fine as long as
no definitions are changed in the library project.

In case definitions are changed in the library project, I would expect that
the executable project integrates these changes as it is set to be dependent
on the library project and hence always built as a second step. In reality,
however, the build operation of the executable project does not recognise
changes in the library. At this time, I found only three unsatisfying ways
to force an update of the reference:

a) Remove the reference to the library and re-add the reference.
b) Switch the current state of the "Copy Local" switch of the executable to
the other option: If it is currently set to "True", a modification towards
"False" will update the reference - the same is true when changing from
"False" to "True".
c) Shut down the .net environment and restart it - the reference will be ok
then.

Now, what I'm looking for is a way to automatically update the dependencies
in a solution build process, i.e. references of the second project to the
first one should be updated (at least) when I try to build the second
project. Az the moment it seems to rely on a (local?) assembly cache as long
as do not update the reference manually as described above.

Any ideas?

Best regards,

John

Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
John,
I'm trying to handle two projects in one solution (.net 2002, both projects are VB). Does your one project reference the first project, or did you reference the
DLL itself?

I normally reference the project itself in VS.NET then VS.NET works out the
correct dependencies, via "Project - Add Reference - Project".

You can use "Project - Dependencies" in solution explorer to control which
project is dependent on which when you reference the DLL itself. However I
reference projects, so I have not verified this method works as expected.

Hope this helps
Jay

"John Lafrowda" <la*****@laa.com> wrote in message
news:bv**********@news.uni-stuttgart.de... Hi all,

I'm trying to handle two projects in one solution (.net 2002, both projects are VB). The first project contains only some public constant definitions
(for the moment) and compiles into class libarary. The second one is builds an executable which has a reference to the assembly of the first project to retrieve global constant definitions. The whole thing works fine as long as no definitions are changed in the library project.

In case definitions are changed in the library project, I would expect that the executable project integrates these changes as it is set to be dependent on the library project and hence always built as a second step. In reality, however, the build operation of the executable project does not recognise
changes in the library. At this time, I found only three unsatisfying ways
to force an update of the reference:

a) Remove the reference to the library and re-add the reference.
b) Switch the current state of the "Copy Local" switch of the executable to the other option: If it is currently set to "True", a modification towards
"False" will update the reference - the same is true when changing from
"False" to "True".
c) Shut down the .net environment and restart it - the reference will be ok then.

Now, what I'm looking for is a way to automatically update the dependencies in a solution build process, i.e. references of the second project to the
first one should be updated (at least) when I try to build the second
project. Az the moment it seems to rely on a (local?) assembly cache as long as do not update the reference manually as described above.

Any ideas?

Best regards,

John

Nov 20 '05 #2

P: n/a
Thanks Jay,

referencing the project instead of the DLL solved the problem (although I
still do not understand why referencing the DLL didn't work since the
references were correctly set in the solution explorer).

Cheers,

John
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schrieb im
Newsbeitrag news:ux*************@TK2MSFTNGP11.phx.gbl...
John,
I'm trying to handle two projects in one solution (.net 2002, both projects
are VB).

Does your one project reference the first project, or did you reference

the DLL itself?

I normally reference the project itself in VS.NET then VS.NET works out the correct dependencies, via "Project - Add Reference - Project".

You can use "Project - Dependencies" in solution explorer to control which
project is dependent on which when you reference the DLL itself. However I
reference projects, so I have not verified this method works as expected.

Hope this helps
Jay

"John Lafrowda" <la*****@laa.com> wrote in message
news:bv**********@news.uni-stuttgart.de...
Hi all,

I'm trying to handle two projects in one solution (.net 2002, both

projects
are VB). The first project contains only some public constant definitions (for the moment) and compiles into class libarary. The second one is

builds
an executable which has a reference to the assembly of the first project

to
retrieve global constant definitions. The whole thing works fine as long

as
no definitions are changed in the library project.

In case definitions are changed in the library project, I would expect

that
the executable project integrates these changes as it is set to be

dependent
on the library project and hence always built as a second step. In

reality,
however, the build operation of the executable project does not recognise changes in the library. At this time, I found only three unsatisfying ways to force an update of the reference:

a) Remove the reference to the library and re-add the reference.
b) Switch the current state of the "Copy Local" switch of the executable

to
the other option: If it is currently set to "True", a modification towards "False" will update the reference - the same is true when changing from
"False" to "True".
c) Shut down the .net environment and restart it - the reference will be

ok
then.

Now, what I'm looking for is a way to automatically update the

dependencies
in a solution build process, i.e. references of the second project to the first one should be updated (at least) when I try to build the second
project. Az the moment it seems to rely on a (local?) assembly cache as

long
as do not update the reference manually as described above.

Any ideas?

Best regards,

John


Nov 20 '05 #3

P: n/a
John,
(although I
still do not understand why referencing the DLL didn't work since the
references were correctly set in the solution explorer). Were the dependencies also set correctly?

Also I'm not sure that VS.NET bothers checking to see if the DLL changed? I
suspect it is assuming the DLL is external to the solution, hence it
"doesn't change" so there is no reason to check to see if it changes.
However I am only surmising...

Hope this helps
Jay

"John Lafrowda" <la*****@laa.com> wrote in message
news:bv**********@news.uni-stuttgart.de... Thanks Jay,

referencing the project instead of the DLL solved the problem (although I
still do not understand why referencing the DLL didn't work since the
references were correctly set in the solution explorer).

Cheers,

John
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schrieb im
Newsbeitrag news:ux*************@TK2MSFTNGP11.phx.gbl...
John,
I'm trying to handle two projects in one solution (.net 2002, both

projects
are VB).

Does your one project reference the first project, or did you reference

the
DLL itself?

I normally reference the project itself in VS.NET then VS.NET works out

the
correct dependencies, via "Project - Add Reference - Project".

You can use "Project - Dependencies" in solution explorer to control which
project is dependent on which when you reference the DLL itself. However I reference projects, so I have not verified this method works as expected.
Hope this helps
Jay

"John Lafrowda" <la*****@laa.com> wrote in message
news:bv**********@news.uni-stuttgart.de...
Hi all,

I'm trying to handle two projects in one solution (.net 2002, both

projects
are VB). The first project contains only some public constant definitions (for the moment) and compiles into class libarary. The second one is

builds
an executable which has a reference to the assembly of the first project to
retrieve global constant definitions. The whole thing works fine as
long
as
no definitions are changed in the library project.

In case definitions are changed in the library project, I would expect

that
the executable project integrates these changes as it is set to be

dependent
on the library project and hence always built as a second step. In

reality,
however, the build operation of the executable project does not recognise changes in the library. At this time, I found only three unsatisfying ways to force an update of the reference:

a) Remove the reference to the library and re-add the reference.
b) Switch the current state of the "Copy Local" switch of the
executable to
the other option: If it is currently set to "True", a modification towards "False" will update the reference - the same is true when changing
from "False" to "True".
c) Shut down the .net environment and restart it - the reference will

be ok
then.

Now, what I'm looking for is a way to automatically update the

dependencies
in a solution build process, i.e. references of the second project to the first one should be updated (at least) when I try to build the second
project. Az the moment it seems to rely on a (local?) assembly cache

as long
as do not update the reference manually as described above.

Any ideas?

Best regards,

John



Nov 20 '05 #4

P: n/a
"John Lafrowda" <la*****@laa.com> schrieb

I'm trying to handle two projects in one solution (.net 2002, both
projects are VB). The first project contains only some public
constant definitions (for the moment) and compiles into class
libarary. The second one is builds an executable which has a
reference to the assembly of the first project to retrieve global
constant definitions. The whole thing works fine as long as no
definitions are changed in the library project.


Did you set the reference to the project or to the compiled file? If you set
it to the project (3rd tab in "add reference" dialog), the 2nd project
should always be up-to-date.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.