Im using this code, inside a project template wizard.
DTE dte = project.DTE;
VSProject vsProj = (VSProject)project.Object;
Array projects = (Array)dte.ActiveSolutionProjects;
Project activeProject = (Project)projects.GetValue(0);
But im curious in what order the projects are 开发者_Go百科returned? The code above is running just after the project is created, in the
public void ProjectFinishedGenerating(Project project)
In what order does the projects get returned?
My goal is to get the newest project, will GetValue(0)
do that?
I looked at this a while back and the order seems to be non-determinstic.
GetValue(0) is the active project which might not be newest project.
To find the newested, you will need to traverse the projects using either the file stamp on the project file (if saved) plus ranking non-saved ones higher as higher.
精彩评论