Re: Easy way to add large numbers of existing source files to project?

From: clintonG (csgallagher_at_REMOVETHISTEXT@metromilwaukee.com)
Date: 05/29/04


Date: Sat, 29 May 2004 11:49:56 -0500

Wel at least working through and documenting here will help
others achieve the same success. Good job.

-- 
<%= Clinton Gallagher
         A/E/C Consulting, Web Design, e-Commerce Software Development
         Wauwatosa, Milwaukee County, Wisconsin USA
         NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
         URL http://www.metromilwaukee.com/clintongallagher/
"Adam Clauss" <cabadam@tamu.edu> wrote in message
news:evHsjtSREHA.3504@TK2MSFTNGP09.phx.gbl...
> Sorry - I forgot to mention what happened with the macro.  It depended
on how I ran it - just like it depended on how I dragged it
> in.
>
> If I ran it such that:
> myproject.ProjectItems.AddFromDirectory(rootFolder)
>
> Then it would do the exact same thing - copy all the actual files over
and create and empty root folder in the project.
>
> If I instead created the root folder manually in the project, and then
ran it as:
>
myproject.ProjectItems("rootfolder").ProjectItems.AddFromDirectory(rootF
older)
>
> then it worked fine.  Notice - I added the SAME root folder.  So I
would get an 'extra' folder layer of the root.
> Ex:
>
> Root
>   | ----Root
>             | ----Sub1
>             | ----Sub2
> ... etc.
>
> To get it to work via drag and drop, I created the root folder
manually, and then selected all the subfolders (rather than the root
> folder) and dragged them into the project (under the folder I manually
created).  This bypassed having the extra layer problem, but
> still is kind of odd that I had to create the first level manually.
> -- 
> Adam Clauss
> cabadam@tamu.edu
> "clintonG" <csgallagher@REMOVETHISTEXT@metromilwaukee.com> wrote in
message news:uzuZdSRREHA.1004@TK2MSFTNGP10.phx.gbl...
> > I want to share that dumb feeling not discussing drag and drop
> > (almost) but I wasn't all that surprised to learn the dragged folder
> > remained empty.
> >
> > The snippet I showed was pulled from a .sln file. If dragging were
to
> > resolve this issue the contents of the .sln file would have to be
> > modified
> > including the reference to what I may have mistakenly referred to as
> > a CLSID Key [1].
> >
> > What happened running the ProjectItem.AddFromDirectory macro?
> >
> > -- 
> > <%= Clinton Gallagher
> >          A/E/C Consulting, Web Design, e-Commerce Software
Development
> >          Wauwatosa, Milwaukee County, Wisconsin USA
> >          NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
> >          URL http://www.metromilwaukee.com/clintongallagher/
> >
> > [1]
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/reg_6vjt.asp
> >
> >
> >
> > "Adam Clauss" <cabadam@tamu.edu> wrote in message
> > news:OqRthaNREHA.3348@TK2MSFTNGP09.phx.gbl...
> > > No... heh the macro wasn't the easy way.  And I cannot believe I
did
> > not think about this.  Just... drag the folder in.  Duh...
> > >
> > > Before I figured out the dragging method, I did start looking at a
> > macro, and it looks like there is one
> > > (ProjectItem.AddFromDirectory()).
> > >
> > > I also may have discovered a bug in VS.  In both using that Macro
and
> > dragging the folders into the project from explorer, if I only
> > > drug the root folder, and drug it so that it would be a top level
> > folder in the project structure - nothign except the top folder
> > > itself got added!
> > >
> > > All of the files got copied over into the solution directory, as I
> > expected - but none of them were actually in the project.  The
> > > top folder got created in the project, but it was empty.
> > >
> > > -- 
> > > Adam Clauss
> > > cabadam@tamu.edu
> > > "clintonG" <csgallagher@REMOVETHISTEXT@metromilwaukee.com> wrote
in
> > message news:%23kH5IWMREHA.3504@TK2MSFTNGP09.phx.gbl...
> > > > The easy way *is* with a macro. There's probably a macro that
> > > > somebody has built already and there's lots of samples that can
> > > > be modified.
> > > >
> > > > Google: "visual studio"+"macro"
> > > >
> > > > If its only for one solution it may not be timely to do so but
> > > > otherwise you can look at it as an oppontunity to finally learn
> > > > how to  do something useful like recursing a directory of files.
> > > > I've got to take on this task myself someday so try to
understand
> > > > I'm not talking down to you.
> > > >
> > > > You might also consider backing up the .sln file and using C#
and
> > > > the framework to modify the .sln file directly but you'll still
have
> > to
> > > > recurse the directories and subdirectories. Study this snippet
of
> > > > a .sln file and note that once the project is created all of the
> > CLIDs
> > > > are identical throughout the entire .sln file. All you'd have to
do
> > is
> > > > write
> > > > a template and fill in the blanks using values from your
recurser.
> > > >
> > > > Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "315C11",
> > > > "http://localhost/70315QUE/315C11/315C11.csproj
> > > > ", " {2F7BB741-BEA0-4243-937E-8C69FBF71649}"
> > > >   ProjectSection(ProjectDependencies) = postProject
> > > >   EndProjectSection
> > > > EndProject
> > > >
> > > > Isn't being a real software developer exciting? :-)
> > > >
> > > > -- 
> > > > <%= Clinton Gallagher
> > > >          A/E/C Consulting, Web Design, e-Commerce Software
> > Development
> > > >          Wauwatosa, Milwaukee County, Wisconsin USA
> > > >          NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
> > > >          URL http://www.metromilwaukee.com/clintongallagher/
> > > >
> > > >
> > > >
> > > >
> > > > "Adam Clauss" <cabadam@tamu.edu> wrote in message
> > > > news:ukL2LiKREHA.4016@TK2MSFTNGP12.phx.gbl...
> > > > > Perhaps, but I was wondering if there was some way, already
> > built-in
> > > > maybe, that would save me the time as I've never done a macro
> > > > > for VS.
> > > > >
> > > > > -- 
> > > > > Adam Clauss
> > > > > cabadam@tamu.edu
> > > > > "clintonG" <csgallagher@REMOVETHISTEXT@metromilwaukee.com>
wrote
> > in
> > > > message news:%23HkXoZGREHA.2520@TK2MSFTNGP11.phx.gbl...
> > > > > > Isn't that what macros are supposed to help get done? Have
you
> > > > tried?
> > > > > >
> > > > > > -- 
> > > > > > <%= Clinton Gallagher
> > > > > >          A/E/C Consulting, Web Design, e-Commerce Software
> > > > Development
> > > > > >          Wauwatosa, Milwaukee County, Wisconsin USA
> > > > > >          NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
> > > > > >          URL http://www.metromilwaukee.com/clintongallagher/
> > > > > >
> > > > > >
> > > > > > "Adam Clauss" <cabadam@tamu.edu> wrote in message
> > > > > > news:u47Ai7FREHA.3608@TK2MSFTNGP10.phx.gbl...
> > > > > > > I have a folder containing many subfolders (and subfolders
> > > > and....)
> > > > > > all containing various .cs files.  Is there any "easy" way
to
> > > > > > > get them all added to the solution.  Preferable would be
that
> > the
> > > > > > folders are actually created in the Solution Explorer so
that I
> > > > > > > can find things easily.
> > > > > > >
> > > > > > > Its easy to select multiple files out of a single folder,
but
> > not
> > > > > > recursively into subfolders.
> > > > > > >
> > > > > > > Any ideas?
> > > > > > >
> > > > > > > -- 
> > > > > > > Adam Clauss
> > > > > > > cabadam@tamu.edu
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: Easy way to add large numbers of existing source files to project?
    ... remained empty. ... The snippet I showed was pulled from a .sln file. ... What happened running the ProjectItem.AddFromDirectory macro? ... drag the folder in. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Easy way to add large numbers of existing source files to project?
    ... Before I figured out the dragging method, I did start looking at a macro, and it looks like there is one ... drug the root folder, and drug it so that it would be a top level folder in the project structure - nothign except the top folder ... > how to do something useful like recursing a directory of files. ... > the framework to modify the .sln file directly but you'll still have to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Easy way to add large numbers of existing source files to project?
    ... Sorry - I forgot to mention what happened with the macro. ... Then it would do the exact same thing - copy all the actual files over and create and empty root folder in the project. ... >>> how to do something useful like recursing a directory of files. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how could i save files in windows folder?
    ... want to select ROM-only Filesystem from the catalog, ... I tried to mount the fatfs as root folder, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: ftp server permission
    ... but my english just soo bad, i cant digest your writing correctly. ... > So you use NTFS permissions to make the root folder unwriteable. ... > I stated earlier that nothing in the FTP server can trump NTFS permissions ...
    (microsoft.public.inetserver.iis.ftp)

Loading