How to nest any custom files, other than .designer.cs /.designer.vb or .aspx.cs, in VS.NET 2005

Hi,
I want to specify somehow to VS.NET 2005 which extensions to nest in the solution explorer.
For example it automatically knows to nest some files such as .Designer.cs or .aspx and .aspx.cs.
I have my classes, and I want to extend that feature to other keywords, such as .Generics.cs or .Properties.cs etc.
My first thought was that there should be some registry keys where you add what keywords are "nesting" the files.
After a lof of research with no luck, I have decided to make my add-in or macro to nest my custom files together.
But, no luck yet, since there is no DOC for these clasess/properties.
E.g. The only doc about FileProperties2.IsDependentFile is on MSDN: This member provides internal-only access to file properties.
Helpless, though.
From a macro, if you set a value to that property IsDependentFile a DISP_E_BADPARAMCOUNT exception is thrown, without other details.
How can I nest my files based on custom keywords
Thanks in advance,
Laurentiu


Answer this question

How to nest any custom files, other than .designer.cs /.designer.vb or .aspx.cs, in VS.NET 2005

  • visualbasicming

    Based on custom keywords I don't know, but on file basis you can do it the following way. Rightclick project in solution explorer (provided that you have something better than express versions) and choose unload project. Rightclick the now unloaded project and choose edit <project>.csproj.

    As an example, the main file is Foo.cs and the dependent file is called Foo.Dependent.cs then you find the

    <Compile Include="Foo.Dependent.cs"/> and change that line to

    <Compile Include="Foo.Dependent.cs">
    <DependentUpon>Foo.cs</DependentUpon>
    </Compile>

    and now you rightclick the project again, and select reload project, and you're done.


  • M. Shariq Muzaffar

    Hi,

    I couldn't find the tag u talked about in <project>.csproj. I'm using Visual Studio 20005 Team Edition.

    I really like to know how to add a file to the subset of another file like Test.Designder.cs which is Test.cs subset.

    With tanks



  • TCSC

    In which Tag should i put this element

  • nglow

    Hi,

    assuming that both your Test.cs and Test.Whatever.cs are included in the project (visible in the solution explorer), then you should find such a tag. Othervise you will have to add it yourself.


  • woodsy99

    Hi,

    Put all your files in the BIN folder of your solution.

    I'm guesssing 2005 works in a similiar fashion to VS2003 in that any files created within a program

    are written to the BIN folder of a solution if you don't provide a full path to the file.

    I've not installed the 2005 version yet. I'm working wih VS2003.

    VisualStudio always looks in the solution folder and BIN folder of a solution first.

    So in a FileOpen statement you can have>>

    'TESTFILE in this example if written or read from is expected to be in the solution BIN folder.

    FileOpen(1, "TESTFILE", OpenMode.Input)
    ' Close before reopening in another mode.
    FileClose(1)

    or

    FileOpen(1, "c:\TESTFILE", OpenMode.Input)
    ' Close before reopening in another mode.
    FileClose(1)

     

     

    Regards,

    S_DS


     

     



  • How to nest any custom files, other than .designer.cs /.designer.vb or .aspx.cs, in VS.NET 2005