locked
How to add Solution Folder RRS feed

  • Question

  • Hi

    Plz if someone can tell me how to add a folder to a solution(not a project).

    Regards,
    Haris
    Monday, June 16, 2008 12:06 PM

Answers

  • I assume that you're talking about VS2005 or 2008.

    There is a method added after VS2005: Solution2.AddSolutionFolder Method (EnvDTE80), and I wrote a macro to show its usage:
    Dim sln2 As Solution2 = DTE.Solution

    'IF ullName of sln2 is "", there should be no solution currently opened in IDE
    If sln2.FullName.Length > 0 Then
        sln2.AddSolutionFolder("TEST solution folder")
    End If

    Hope this helps!

    Thanks!

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by HarisM Tuesday, June 17, 2008 6:09 AM
    Tuesday, June 17, 2008 3:42 AM

All replies

  • do you mean something like that:

    project.ProjectItems.AddFolder("Libraries", EnvDTE.Constants.vsProjectItemKindPhysicalFolder);


    ??

    mika

    Monday, June 16, 2008 1:24 PM
  • I assume that you're talking about VS2005 or 2008.

    There is a method added after VS2005: Solution2.AddSolutionFolder Method (EnvDTE80), and I wrote a macro to show its usage:
    Dim sln2 As Solution2 = DTE.Solution

    'IF ullName of sln2 is "", there should be no solution currently opened in IDE
    If sln2.FullName.Length > 0 Then
        sln2.AddSolutionFolder("TEST solution folder")
    End If

    Hope this helps!

    Thanks!

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by HarisM Tuesday, June 17, 2008 6:09 AM
    Tuesday, June 17, 2008 3:42 AM
  • Thanks Feng, It worked.
    Tuesday, June 17, 2008 6:10 AM