Sign in to follow this  
Zeblar Nagrim

Visual Studio always rebuild my project! :(

Recommended Posts

I have problem with visual studio.Net 2003. Every time i press the build button it rebuild the project, even if the project is already compiled and nothing have chaged! I have done a clean and removed all strange config filed like *.ncb etc. Doesn't help. I have checked the time stamp on the files and re-saved them, doesn't help. My system clock is correct. I can't figure this out! Have tried almost evertything for 2 days. Now I almost ready to reinstall Visual Studio and if that doesn't work, reinstall Windows XP. Btw... It's only in one project that this strange compile bug happends. Not in my other VS projects. Thanks.

Share this post


Link to post
Share on other sites
Have you tried creating a new empty project, and adding your current project files back into it? A very rough guess is that it's something to do with your project settings.

Share this post


Link to post
Share on other sites
Quote:
Original post by Zeblar Nagrim
I have problem with visual studio.Net 2003. Every time i press the build button it rebuild the project, even if the project is already compiled and nothing have chaged!

Thanks.


I'm confused. You say it builds when you click build, even though it's already compiled. VC has done that for a while now. There is a difference between compiling and linking. Even if everything is compiled, when you click build - it's going to build your project.

Even if I'm mistaken, then I don't understand why this is even an issue. Why are you clicking the button if you don't want to build??

Share this post


Link to post
Share on other sites
Quote:
Original post by DesCr
Quote:
Original post by Zeblar Nagrim
I have problem with visual studio.Net 2003. Every time i press the build button it rebuild the project, even if the project is already compiled and nothing have chaged!

Thanks.


I'm confused. You say it builds when you click build, even though it's already compiled. VC has done that for a while now. There is a difference between compiling and linking. Even if everything is compiled, when you click build - it's going to build your project.

Even if I'm mistaken, then I don't understand why this is even an issue. Why are you clicking the button if you don't want to build??


There's a difference between build and rebuild. At work, some of our projects take about 12-40 hours to build the whole application. Now, if I want to make a small change, such as a bug fix, I don't want to wait hours. I just want the one object to build. When you build with Visual Studio, it should only build the object files that have changed, not the whole application. And as far as solving this, if you've checked your system date, follow felisandria's advice.

Share this post


Link to post
Share on other sites
I've noticed that in a few projects when I see if _WIN32 is defined before including any headers or anything and end it before including any headers, I had the exact same problem as you. I have no idea why it was that way, and it was a really weird error, but oh well, I'm glad I fixed it, heh. The only files affected where the ones that had checked the _WIN32 though, so good luck finding the problem, it took me a while to find..

Share this post


Link to post
Share on other sites
Quote:
Original post by felisandria
Try deleting your problem project's .ncb and .suo files before you take extreme measures. They will remake themselves, so don't worry.

-fel


I have already tried that. I work in a team with 3 other people and have removed the entire source folder and checked out it again from CVS. And the problem remain... It's VERY strange.

Share this post


Link to post
Share on other sites
If the timestamp on any of your project files is less than your system date, visual studio will rebuild them. I guess they use this system because it is less expensive than checksumming the files or something.

I experienced this problem myself when a friend in finland sent me some source files from 10 hours in the future. (sounds funny huh? :) I have also experienced this problem when my comp shut down improperly in a power outage and my system clock was reset.

So, if it's because of an incorrect system time, just set your clock.
Otherwise, if your files have the wrong time download touch for windows here, stick it in your path and touch *.* in your source folder to fix all the dates.

Share this post


Link to post
Share on other sites
Quote:
Original post by Melekor
If the timestamp on any of your project files is less than your system date, visual studio will rebuild them. I guess they use this system because it is less expensive than checksumming the files or something.

I experienced this problem myself when a friend in finland sent me some source files from 10 hours in the future. (sounds funny huh? :) I have also experienced this problem when my comp shut down improperly in a power outage and my system clock was reset.

So, if it's because of an incorrect system time, just set your clock.
Otherwise, if your files have the wrong time download touch for windows here, stick it in your path and touch *.* in your source folder to fix all the dates.


Thanks Mekekor, I will try that.

Share this post


Link to post
Share on other sites
check the solution/project settings... I think theres an option for incremental building/linking.

Or, in general, check all the settings - because some of them do disallow partial rebuilds.

I know I found such an optimization/setting a while back.

hth
Jack

Share this post


Link to post
Share on other sites
One of the files you modified may inadvertently include the some or all of the rest of your project. You might want to make sure you're making proper use of include guards. Also, you might not want to include everything in every file if nothing else works.

Share this post


Link to post
Share on other sites
It's a console(command line) program. First put it in your windows folder. Then open up a console window in the folder where you want to use it enter touch [commands]. For example, touch *.* will set the timestamp of all the files in that folder to the current time. Run the program with no arguments to get the usage message.

Share this post


Link to post
Share on other sites
Quote:
Original post by Melekor
It's a console(command line) program. First put it in your windows folder. Then open up a console window in the folder where you want to use it enter touch [commands]. For example, touch *.* will set the timestamp of all the files in that folder to the current time. Run the program with no arguments to get the usage message.


OK, tried that didn't help :( Thanks anyway.

Share this post


Link to post
Share on other sites
Quote:
Original post by Verg
Have you tried creating a new empty project, and adding your current project files back into it? A very rough guess is that it's something to do with your project settings.


Yes I have.

Share this post


Link to post
Share on other sites
Looks like dependency checking is your culprit. I'm not familiar with .NET myself (still prefer 6.0) but here's an article that might help you

http://support.microsoft.com/default.aspx?scid=%2Fservicedesks%2Fwebcasts%2Fen%2Fwc040502%2Fwct040502.asp

Share this post


Link to post
Share on other sites
That is a article about "Moving Applications from Microsoft Visual C++ 6.0 to Microsoft Visual Studio .NET". I don't think that can help me... Like I said, we are 4 people in the team, working with the same code and only I have this problem. I don't know what it is, evertyhing worked fine until yesterday. Maybe it's a virus that do strange thing with my computer clock? I have no more ideas now, so I try and reinstall Visual Studio (but I don't think that will help either because the problem is specific for just this project).

Share this post


Link to post
Share on other sites
Hmm. Because from there I got:

To set this compiler option in the Visual Studio development environment

Open the project's Property Pages dialog box. For details, see Setting Visual C# Project Properties.
Click the Configuration Properties folder.
Click the Advanced property page.
Modify the Incremental build property.

Share this post


Link to post
Share on other sites
Look in the build log after you have rebuilt the project. It sometime contain more information than is shown in the output window.

For example:
Build log was saved at "file://c:\Documents and Settings\abc\My Documents\Visual Studio Projects\def\Debug\BuildLog.htm"

It sometimes has the PRJ0041 error: "Cannot find missing dependency 'dependency' for file 'file'. Your project may still build, but may continue to appear out of date until this file is found."

It has probably something to do with the resources, are you using RC2-files? Check that the includes in them are correct and that the additional include directories are correct for resource files for the project.

Share this post


Link to post
Share on other sites
Quote:
Original post by DesCr
Hmm. Because from there I got:

To set this compiler option in the Visual Studio development environment

Open the project's Property Pages dialog box. For details, see Setting Visual C# Project Properties.
Click the Configuration Properties folder.
Click the Advanced property page.
Modify the Incremental build property.


Modify to what? And how can this help me solve this problem?

Share this post


Link to post
Share on other sites
Quote:
Original post by dalleboy
Look in the build log after you have rebuilt the project. It sometime contain more information than is shown in the output window.

For example:
Build log was saved at "file://c:\Documents and Settings\abc\My Documents\Visual Studio Projects\def\Debug\BuildLog.htm"

It sometimes has the PRJ0041 error: "Cannot find missing dependency 'dependency' for file 'file'. Your project may still build, but may continue to appear out of date until this file is found."

It has probably something to do with the resources, are you using RC2-files? Check that the includes in them are correct and that the additional include directories are correct for resource files for the project.



Thanks, but I have already looked in the buildlog... and guess what... no information to find :( And we use no .NET Resources or any other Visual Studio Resoureces what so ever. Thanks anyway...

Share this post


Link to post
Share on other sites
I don't know if it's been mentioned.. too lazy to read I guess, but the problem is more than likely the fact that you are sharing files with other people.

Somebody else's machine has the date set incorrectly... so the properties of your source files need fixing. Look at every source file you shared and make sure that the modified date is not greater than your current clock time. If that is the case you'll need to modify the file or recreate it, then scold your teammember for not setting his/her time correctly.

Share this post


Link to post
Share on other sites
And that's not going to help. If it's only one project that does this, the problem lies with the project itself, not MSVS or Windows XP.

Now, every time you click the Build button, it rebuilds EVERYTHING or it just does a few files and then links? If it's the latter case, that's pretty much what it's supposed to do. It shouldn't do that when building a project in which you haven't changed anything since the last build, but if ANYTHING changes, even just a line of comments in a source file, it'll have to rebuild it.

And if you change something in a header file, it will rebuild all files that #include that file.

I'm almost certain there's a problem somewhere in the project file, or worst case the registry entries that might get made to accompany that project.

If it's the registry, then reinstalling Windows might fix it, I guess, but at great expense and inconvenience.

EDIT: And Schmedly covered the other possibility I had thought of. Try that, it's quite likely to be the problem.


-Auron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this