From: Hector Santos on
David Ching wrote:

> "Simon" <bad(a)example.com> wrote in message
> news:#4YIDsnnKHA.5696(a)TK2MSFTNGP04.phx.gbl...
>> Hi,
>>
>> I have a solution with 12 projects.
>> When I do a rebuild of the solution everything looks file, no warnings
>> and no error.
>>
>> Then, without changing anything I select "Build Solution" and the
>> compiler always rebuilds 2 or 3 of the projects.
>>
>> The output folder is on my machine, there are no issues with the clock
>> or anything like that.
>>
>> So what could cause the compiler to think it needs to rebuild those
>> project?
>>
>
> Does the solution have the same problem on another machine? If not,
> that says it's not in any of the code but something on the machine.
>
> What is the first file that continually builds? Does that have any
> specific dependencies like a file that might have been built temporarily
> and deleted so that has changed, and thus the file gets rebuilt?
> Unfortunately, I don't think Visual Studio has any debug flags that you
> could ask it to dump the dependency that caused the rebuild.

Yes, that would be nice.

The only time I recall having a similar issue was a timestamp issue.
With source code across different machines, something was off, don't
recall what, but that it was intermittent. Sometimes it rebuild
unexplained, sometimes it did not. But synchronizing the machine
times and retouching some files fixed the issue.

--
HLS
From: Woody on
FWIW, I have a solution with a single, simple C++ project, no pre- or
post-build steps. It rebuilds every time in VS2010 beta 2.
From: Simon on
On 2010/01/26 05:19 PM, David Ching wrote:
> "Simon" <bad(a)example.com> wrote in message
> news:#4YIDsnnKHA.5696(a)TK2MSFTNGP04.phx.gbl...
>> Hi,
>>
>> I have a solution with 12 projects.
>> When I do a rebuild of the solution everything looks file, no warnings
>> and no error.
>>
>> Then, without changing anything I select "Build Solution" and the
>> compiler always rebuilds 2 or 3 of the projects.
>>
>> The output folder is on my machine, there are no issues with the clock
>> or anything like that.
>>
>> So what could cause the compiler to think it needs to rebuild those
>> project?
>>
>
> Does the solution have the same problem on another machine? If not, that
> says it's not in any of the code but something on the machine.

Yes, it does.
One machine is WinXP pro and the other is Win7 Ultimate.

Both cause a rebuild.

> What is the first file that continually builds? Does that have any
> specific dependencies like a file that might have been built temporarily
> and deleted so that has changed, and thus the file gets rebuilt?
> Unfortunately, I don't think Visual Studio has any debug flags that you
> could ask it to dump the dependency that caused the rebuild.
>

The rebuild seems to be a bit random, (although I am sure it is not),
but I cannot really tell what is causing the rebuild.

Out of the 12 projects, if I make a change to project 'A' then project
'E' might be the one that rebuild.

Maybe it has something to do with the output folder, they all use the
same configuration for the output folder,
$(SolutionDir)$(ConfigurationName), that should put all the output files
in their own folders.

Simon
From: Mihajlo Cvetanović on
I remember having the same problem in VS2003, and it went away only when
I moved .rc2 file from /res to project folder.

In VS2008 I had something similar, and it went away when I changed
project option not to embed manifest file into exe.
From: Simon on
> I have a solution with 12 projects.
> When I do a rebuild of the solution everything looks file, no warnings
> and no error.
>
> Then, without changing anything I select "Build Solution" and the
> compiler always rebuilds 2 or 3 of the projects.
>
> The output folder is on my machine, there are no issues with the clock
> or anything like that.
>
> So what could cause the compiler to think it needs to rebuild those
> project?
>

As a follow-on to my own question.

My projects are all doing a post build event, (it should have been a
pre-link event but it does not matter in that case).

All the build event does is, update a text file with an ever growing
build number so that our install app, (Inno Setup), can pick it up and
display that number.

Although the file is not used in the projects it was still causing the
rebuild.

So I changed the build event app to change the modified time to -5
minutes and that seems to do the trick.

I know it sound more like a hack or anything but I don't know how to
tell VS2008 to ignore the 'modified' timestamps of a file, (or to ignore
a file completely for that matter).

Thanks,

Simon