Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Add Ref to EnvDTE80.dll
- // Warning : Close All VS instance before running :)
- public string BuildSolution()
- {
- StringBuilder status = new StringBuilder("Projets non traités :");
- status.AppendLine();
- try
- {
- EnvDTE80.DTE2 dte2;
- dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.11.0");
- dte2.Solution.Create(@"D:\Temp\", "AllSLProjects");
- foreach (string projectFile in this.allProj)
- {
- try
- {
- dte2.Solution.AddFromFile(projectFile, false);
- }
- catch (Exception ex )
- {
- status.AppendFormat("{0} : {1}{2}", projectFile, ex, Environment.NewLine);
- }
- }
- dte2.Solution.SaveAs("AllSLProjects.sln");
- dte2.Quit();
- }
- catch (Exception e)
- {
- Debug.WriteLine(e.ToString());
- }
- return status.ToString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement