how do I check if a project is up-to-date?
I'm basically trying to programmatically build each project in a list but only if they have changed. So does anyone know of a way (using EnvDTE maybe) to check if a project changed and therefore needs to compile?
Thanks in advance for all the help.
Use the EnvDTE.Document interface:
The Saved property will be false if the document is dirty.
You can do it using the UpToDate property of VCConfiguration.
Assuming you can get an instance of EnvDTE.DTE you can get the required VCProjectEngine VCConfiguration for the active project like this:
If you wanted to do all projects in the solution then it would be easier as you don't need to find the startup project. The important part is converting an instance of DTE Project to a VCProjectEngine VCProject, looping the VCConfigurations once you've done that should be easy.
Also worth noting that VCConfiguration.Build() will only build that configuration and fail if the dependencies haven't been built. You can use SolutionBuild.BuildProject() to build the project and its dependencies.