VS2010- Compile time stamps will not let new code be compiled

Bloqueada VS2010- Compile time stamps will not let new code be compiled

  • lunes, 12 de marzo de 2012 13:14
     
     

    Hello guys,

    I recenty made a modification to a to VS2010 C# Windows Form project, compiled and saved it.

    But after i did, i noticed my system date/time was set to 2013 (some time in the future), so i set it back to the current date.

    Now vs2010 lets me save any modifications to this project but will not compile the source code unless the system date is set to some time after that 2013 future point.

    After some research i realized that vs2010 time stamps all its compiled source code and will not recompile it unless the newer timestamp is some time after the last point.

    Can someone tell me how to fix this, i was thinking of just delete the compiled code someware in the system but dont know where to find it!

Todas las respuestas

  • lunes, 12 de marzo de 2012 13:46
    Moderador
     
     Respondida

    To avoid excessive compilations VS does a timestamp comparison between source code changes and binary generation to determine if a file has changed.  When the system time is modified like this it can cause issues (and not just with VS).

    To resolve the issue do a Rebuild Solution.  This will clean the existing binaries and then build all the soruce again.

    Michael Taylor - 3/12/2012
    http://msmvps.com/blogs/p3net

    • Marcado como respuesta jbeteivazi lunes, 12 de marzo de 2012 14:48
    •  
  • lunes, 12 de marzo de 2012 14:19
     
     

    Thanks, i see what you mean but my VS2010 Ultamit does not give me that option.

    In the menu bar under build all i see is Build Soulution, Build <project name>, Publish <project name>, and Run Code Analysis on <project name>.

  • lunes, 12 de marzo de 2012 14:31
    Moderador
     
     Respondida

    Interesting that you don't have the option as it is one of the default ones.  Note that it is context sensitive so if you have a project selected in Solution Explorer it could hide some options.

    Nevertheless the command is available.  There is no shortcut key associated with it but you can use Customize to add it to the menu or a toolbar.  Alternatively if Clean Solution is available then it'll wipe the existing binaries and then you can build again.  You can also use Tools\Options -> Keyboard to map a hotkey to Rebuild Solution instead of modifying the menu.

    As an aside make sure Tools\Options -> Projects & Solutions\General -> Always show Solution is checked.  It is possible that this is hiding the menu item. 

    Michael Taylor - 3/12/2012
    http://msmvps.com/blogs/p3net

    • Marcado como respuesta jbeteivazi lunes, 12 de marzo de 2012 14:48
    •