Search code examples
projects-and-solutionsasp.net-corevisual-studio-2015asp.net-core-mvc

How can I hide files from Solution Explorer by name in VS2015?


I am writing a website in VS2015 using the ASP.NET Preview template. Unfortunately, Dropbox has added a bunch of .dropbox.attr files in each folder of my project, which the Solution Explorer is displaying:

.dropbox.attr files

Note that I have not added them to the project manually, (they are not referenced in my Web.xproj,) and I do not have "Show All Files" selected. I have already added them to my .gitignore. There is no "Remove" option when selecting the file:

.dropbox.attr context menu

Lastly, I have tried adding them to my project.json's exclude section:

...

"publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc",
    ".dropbox.attr"
],

"exclude": [
    "wwwroot",
    "node_modules",
    "bower_components",
    ".dropbox.attr"
]

...

Is there any way to get all files with this name to not appear in my Solution Explorer?

I'm not sure exactly of the interaction between VS2015 and the new project structure, so it could be a result of any of those factors.


Solution

  • You can modify the .xproj file of your project and add the following to exclude folders:

    <ItemGroup>
        <DnxInvisibleFolder Include="wwwroot\jspm_packages\" />
        <DnxInvisibleFolder Include="wwwroot\node_modules\" />
    
        <DnxInvisibleContent Include="wwwroot\tsd.json" />
    </ItemGroup>
    

    You can use DnxInvisibleFolder for folders and DnxInvisibleContent for files. Some folders (like node_modules) have sometimes thousands of folders/files which seem to pose a major problem for VS2015 to scan and load.