Addding folder in solution explorer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kmldeep
    New Member
    • Oct 2008
    • 1

    #1

    Addding folder in solution explorer

    how to add folder in solution explorer at runtime in C#.net
  • Ganesh9u
    New Member
    • Oct 2008
    • 23

    #2
    DirectoryInfo d = new DirectoryInfo() ;
    d.Create(@"your solution explorer path eg.Eg E:\projectname\ \folder name");

    Comment

    • joedeene
      Contributor
      • Jul 2008
      • 579

      #3
      Originally posted by Ganesh9u
      DirectoryInfo d = new DirectoryInfo() ;
      d.Create(@"your solution explorer path eg.Eg E:\projectname\ \folder name");
      i dont think this works at runtime because i tried using io.directory.cr eate(), same thing basically, and it didnt pop up, but when i open the directory in windows explorer i can see the created folder there, just not in the solution explorer at runtime...

      joedeene

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Why do you need to add a folder to your solution? I can see why it wouldn't be easy, realistically, the app isn't really part of the solution. It is the result, but it isn't running in the context of the solution. You might have to add the directory and edit the .sln file. Open it up with notepad or wordpad. You might be able to figure out what's going on in the solution.

        Comment

        • l034n
          New Member
          • Oct 2008
          • 15

          #5
          You will have to add it in your .csproj file, like this:

          <ItemGroup>
          <Folder Include="MyNewF older\" />
          </ItemGroup>

          I agree with insertAlias on this as i can not see any point at all of what you want to do (unless you're building another VisualStudio, or some batch solution maker).
          But anyway, that's the way to add the folder in the solution.

          Cheers

          Comment

          Working...