locked
One project in two solutions => project out of date RRS feed

  • Question

  • Hi,

    I have the same project in two different solutions. If I edit one of the files in that project as part of solution A and (re)build the project in solution A, then a (re)build is also required in solution B of the same project. I keep both solutions open in VS

    How to fix this? It seems that the timestamp of that file is solution bound.

    Regards,

    Kootje


    • Edited by ms-kootje Tuesday, March 31, 2015 11:13 AM
    Tuesday, March 31, 2015 11:13 AM

Answers

  • Hi Tina-Shi,

    I have found out the following:

    If both solution files are in the same folder than everything is fine. Meaning:

    I have three solutions A, B and C. They all contain project 1. A and B are in different folders and A and C are in the same folder on disk.

    Editing one of the files of project 1 in solution A and building solution C means:

    - Starting a debug session in solution A => no out of date message for project 1.

    - Starting a debug session in solution B => An out of date message for project 1 appears.

    This is all because of the location of the solutions.

    The suggested blogs for finding out why the project is out of date in solution B revealed that none of the cpp files were out of date. So it has to be something else.

    Just changing the options of VS2013

    Tools->Options->Projects and Solutions->Build and Run->MSBuild project build output verbosity = Diagnostic

    Tools->Options->Projects and Solutions->Build and Run->MSBuild project build log file verbosity = Diagnostic

    And press build in Solution B showed a very extensive build log output in the same instance of VS2013 (no debugview required)

    In the end it seems that the file project1.lastbuildstate contains the path to the solution, which is different for solution A and B but the same for A and C. And thats why it is popping up the out of date dialog before debugging.

    Kind regards,

    Kootje

    Friday, April 3, 2015 11:43 AM

All replies

  • What is your point of putting same project in two different solutions? Why don't you reference this project in one of the solutions and keep the code in another?

    Fouad Roumieh

    Tuesday, March 31, 2015 11:21 AM
  • Hi,

    The why is not really important to my opion. But here it is:

    I am working on pruduct A which has its own set of projects and it uses projects from solutions 1,2,3,4 and 5. I have to change code in all of these projects for product A. Your suggestion means that I have to switch between solutions all the time. And that is not very practical.

    I am also working on product B once in a while and that product also uses projects from the same pool.

    All of these projects are now out of date according to the solution for Product B and I have to build them again. The projects all have an DLL as output, so there is no real need to recompile: they are up to date.

    Kind regards,

    Kootje

    Tuesday, March 31, 2015 12:43 PM
  • We ask to get a better understanding of your problem, I don't understand why do you need to keep switching between solutions in my scenario. However you can have a look at the link file option in visual studio here:

    https://msdn.microsoft.com/en-us/library/9f4t9t92%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396


    Fouad Roumieh

    Tuesday, March 31, 2015 1:14 PM
  • Maybe I do not understand your suggestion. Can I edit and build the linked project without getting the warning in the other solution?

    Let me try...

    Step 4 "From the Open button drop-down list, select Add As Link." does not seem to exist in vs2013. I end up with the project file as text in the solution

    Tuesday, March 31, 2015 2:09 PM
  • This is a screenshot from VS Ultimate 2013


    Fouad Roumieh

    Tuesday, March 31, 2015 6:20 PM
  • It is probably not part of visual studio 2013 premium: see screenshot

    • Edited by ms-kootje Tuesday, March 31, 2015 9:37 PM
    Tuesday, March 31, 2015 9:24 PM
  • I've checked VS 2010 Pro and it exists. You can post another question regarding this.

    More explanation on "Add as Link"

    https://msdn.microsoft.com/en-us/library/windows/apps/jj714082%28v=vs.105%29.aspx?f=255&MSPPError=-2147217396


    Fouad Roumieh


    Wednesday, April 1, 2015 5:30 AM
  • Hi Kootje,

    Thank you for posting in MSDN forum.

    According to your description, you mean that when you open this project in two solution, and then you edit one of the files in that project in solution A. But when you switch to another solution, you get the error: project out of data, am I right?

    If yes, I tried to open same project in two different solutions. And then I edit one of the files in that project as part of solution A and (re)build the project in solution A, then when we switch this same project in the solution b from VS, there will occurs the message like the following screen shot.

    So could you please tell me if you get same message after you switch to same project in another solution B?

    If no, generally, I know that when we modify same project in different solution from VS IDE, it will occur the message as the above screen shot.

    In addition, I suggest you could try to go to the Tools->options->Projects and Solution->Build and Run check if your setting like the screen shot.

    If no, please try to set the build and run setting and then check this issue.

    In addition, if possible, I suggest your could try to reset your VS setting file and then check this issue again.

    If I misunderstanding your issue, could you please tell me more detailed message about your issue.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 1, 2015 8:01 AM
  • My screenshot of the "add existing item" dialog does not show the dropdown box arrow next to the add button. Did you try this for a C++ project in MSDev 2013 premium?

    So, this seems as a dead end to me.

    Nevertheless, thanks for your quick replies

    Kootje

    PS my visual studio info:

    Microsoft Visual Studio Premium 2013
    Version 12.0.31101.00 Update 4
    Microsoft .NET Framework
    Version 4.5.50938

    Installed Version: Premium

    Visual C++ 2013  
    Microsoft Visual C++ 2013


    • Edited by ms-kootje Wednesday, April 1, 2015 8:17 AM
    Wednesday, April 1, 2015 8:13 AM
  • No that was on a C# project from my side, you can try on C# project. I've checked it on C++ on VS 2010 and yes it is not there. But I'm seeing in one of the dirs in C++ project a linked directory, maybe there is another way of doing it there, will check.

    Fouad Roumieh


    Wednesday, April 1, 2015 8:22 AM
  • Hi Tina Shi,

    Indeed. Steps taken

    0. Two solutions with C++ project A as startup project 

    1. Edit one of the files project A in soltuion 1

    2. Build project A in solution 2.

    3. Start debugging project A in solution 1

    Following message:

    My build and run options are the same as in your screenshot

    Solution 2 is our nightly build solution with over 100+ prjects with all kinds of dependencies / references and solution 1 is typically for one of our products.

    Thanks in advance,

    Kootje


    • Edited by ms-kootje Wednesday, April 1, 2015 9:05 AM
    Wednesday, April 1, 2015 8:58 AM
  • Hi Tina-Shi,

    I only get this message when the file that I have been editing is loaded in the source editor:

    In other words. No, I do not get this message.

    Kind regards,

    Kootje

    PS I am using C++.

    Wednesday, April 1, 2015 12:10 PM
  • It seems that this problem is already out there for quite some time. see also:

    Same problem reported in 2011


    • Edited by ms-kootje Wednesday, April 1, 2015 8:37 PM
    Wednesday, April 1, 2015 8:36 PM
  • Hi Kootje,

    Thanks for your reply,

    According to your description, I tried to create a simple 32 C++ console application and then open this application in two different solution. I found that when we edit the console application on the solution A and then build the Solution A in VS2013, then I switched this same console application in another solution B, I found that I still get the message dialog box as the above provided screen shot.

    After I select the Yes or Yes to All option in the message dialog box, we can debug this console application successfully in the Solution B without this project out of data error message.

    So please try the above steps to create a simple C++ project and then check if you still get the project out of data error message.

    In addition, about the project out of data error message, I suggest you could refer the following blog to check this issue.

    http://blogs.msdn.com/b/dsvc/archive/2013/03/12/alwayscreate-forces-project-to-be-re-built.aspx

    Or you could also refer the following thread to check your issue.

    http://stackoverflow.com/questions/2762930/vs2010-always-thinks-project-is-out-of-date-but-nothing-has-changed

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 2, 2015 3:22 AM
  • Hi Tina-Shi,

    I have found out the following:

    If both solution files are in the same folder than everything is fine. Meaning:

    I have three solutions A, B and C. They all contain project 1. A and B are in different folders and A and C are in the same folder on disk.

    Editing one of the files of project 1 in solution A and building solution C means:

    - Starting a debug session in solution A => no out of date message for project 1.

    - Starting a debug session in solution B => An out of date message for project 1 appears.

    This is all because of the location of the solutions.

    The suggested blogs for finding out why the project is out of date in solution B revealed that none of the cpp files were out of date. So it has to be something else.

    Just changing the options of VS2013

    Tools->Options->Projects and Solutions->Build and Run->MSBuild project build output verbosity = Diagnostic

    Tools->Options->Projects and Solutions->Build and Run->MSBuild project build log file verbosity = Diagnostic

    And press build in Solution B showed a very extensive build log output in the same instance of VS2013 (no debugview required)

    In the end it seems that the file project1.lastbuildstate contains the path to the solution, which is different for solution A and B but the same for A and C. And thats why it is popping up the out of date dialog before debugging.

    Kind regards,

    Kootje

    Friday, April 3, 2015 11:43 AM