Introducing File Nesting extension for Visual Studio

Play Introducing File Nesting extension for Visual Studio

The Discussion

  • User profile image

    And for VISUAL STUDIO 2012 guy ? ;)

  • User profile image
    Mads Kristensen

    That is my plan but so far I get errors when I try. I haven't given up though, but if you know some tricks, please see if you can make it work. I've already made it so the project can be opened in VS2012 (you need the VS2012 SDK too).

  • User profile image
  • User profile image

    Great feature. 3 questions

    1) What is the purpose of this feature, can you please help explain. When I have 2 files "bootstrap.js" & "bootstrap.min.js" enabled using with "File nesting" does that mean anytime when we load the file "bootstrap.js" it automatically loads the content of file "bootstrap.min.js" too

    Can you please explain how this really works. It sounded like ".inc" file concept from ASP days

    2) Once "File nesting" is defined manually using VS IDE, where is that information saved within the project?

    3) You did mention something about the RULES based on which the "File nesting" is defined. Where is that RILE information saved within the project?

    Thanks in advance

  • User profile image


    Will this be part of next release of Web Essentials?  Or do you plant to keep it separate?

  • User profile image


    When I enable the automatic nesting, it doesn't do anything on some files like:

      jquery.validate.js and jquery.validate.min.js

    Is it normal? Or I'm missing something?


  • User profile image
    Mads Kristensen


    1) This doesn't effect anything in your app at all. Either runtime or design time. All it does is to change the visual representation in solution explorer. It does write to your .csproj file to make it work, but it doesn't have any functional impact.

    2) In the .csproj file

    3) The rules are not saved in the project. You can find them in Tools -> Options -> File Nesting


    I'm not sure. I don't think I will since this is not a web specific feature. However, I said the same thing with the Image Optimizer extension and it's now part of Web Essentials.


    Make sure the rules are enabled by going to Tools -> Options -> File Nesting and setting them all to true.

  • User profile image
    Konstantin Tarkus

    While this is a nice extension to have. I'm concerned that this file nesting usage can lead to further diversity of Visual Studio and non-VS (WebStorm etc.) projects.

    I would personally love if Visual Studio would support directory based projects (without .proj files). This way they could be opened in WebStorm or other IDEs.

    The most talented HTML/CSS front-end developers I know prefer working in WebStorm or Sublime Text 2 and are not willing to learn Visual Studio. If Visual Studio web application projects would be compatible with other IDEs and commonly used tools like Grunt, having project structure commonly used in front-end community, I would be able bring the most brilliant front-end developers to the team, otherwise I have to look into Node.js and other alternatives.

  • User profile image
    Mads Kristensen


    This is already supported and has been since VS2005. It's not that well-known though. There are 2 web project systems in VS - one is a project file (.csproj) system and the other is a folder based system.

    In Visual Studio, go to File -> New Website... to create a folder based web project. It will automatically do the correct nesting if you have Web Essentials installed (it's a free download). 

  • User profile image

    Nice extension! As for manual nesting, wouldn't it be easier if you'd just allow dragging the file onto another, with some modifier key (like Shift or Alt)? You would then be able to quickly arrange files in hierarchies in a visual manner without tediously selecting from drop down lists all the time.

  • User profile image
    Mads Kristensen


    Yes, but I can't get to the drag 'n drop events from Solution Explorer. I don't think they have added hooks for that. If you know a trick to make it work, please share

  • User profile image
    Mads Kristensen

    The extension now supports Visual Studio 2012

  • User profile image

    Hi Mads,

    First of all I really like this idea and thanks for providing this tool :)

    I am using VS Prof 2013 and I tried to nest my files unfortunately I am not getting any error message and it just silently fails and there is no change in Solution Explorer. I think there might be some conflict with other tools (I did disable Productivity Power Tool and few others but no luck so far) so I am wondering does the tool log errors any where if yes could you please let me know the path? I would love to organize my files using your tool. Thanks.

  • User profile image

    I just wanted to let everyone know that since Visual Studio 2017 15.6 Preview 4 (which was made available a few days ago) users have the ability to control how file nesting works in Solution Explorer.

    Check out this blog posts for more details:

Add Your 2 Cents