1

I have an Asp.net 5 project with a package.config in the root. This creates a hidden node_modules folder in the root. Visual Studio can't see it (unless you choose 'show all files') and TFS does not see it.

Using gulp, I copy some files under node_modules to the wwwroot folder so they will be available to my client. I mimic the same structure starting with a node_modules folder in the wwwroot folder. I can't seem to hide these from VS/TFS.

I have a .tfignore file in the wwwroot folder with this line:\node_modules. I have also tried using .tfignore in other places, such as at the solution level. I can't get it too work.

I tried editing the project file and adding DnxInvisibleContent but it seems to only work at the file level and not on the entire folder. I have this entry which is not working: <DnxInvisibleFolder Include="wwwroot\node_modules\" />

(I also tried DnxInvisibleContent)

I have this is project.json but it's not doing it.

"exclude": [
    "wwwroot",
    "node_modules",
    "wwwroot/node_modules"
  ]

I am using Visual Studio 2015 with update 1. I don't really have to hide node_modules from VS but I need to hide it from TFS.

This is my project layout. I have one .tfignore at the project level and another inside wwwroot.

solution
-.tfignore
-Angular2Client
----wwwroot
-------node_modules
-------.tfignore

The contents of .tfignore at the solution level is:

\packages
\.vs
\wwwroot\node_modules

The contents of .tfignore in the wwwroot folder is:

\node_modules
Don Chambers
  • 3,798
  • 9
  • 33
  • 74
  • Are you using local workspaces with TFS? If not the .tfignore, AFAIK, doesn't do a lot in that case. You can try to manually exclude them in your Team Explorer, make sure you delete them, then commit that, then add them back and specifically click exclude. – janpieter_z Dec 28 '15 at 16:40
  • In manage workspaces I have a local folder for the workspace. Does that mean it's local? I don't like every developer needing to remember to exclude something on every check-in - it will eventually get missed.. – Don Chambers Dec 28 '15 at 16:53
  • Please use this (https://msdn.microsoft.com/en-us/library/bb892960.aspx) to find out of you're using a local workspace. The files will always be on a local folder, but with a local workspace you can also edit them while not being connected. A way to test this is disable your internet connection and see what happens. Depending on the outcome of that you can choose which method. .tfignore should work fine for a local, otherwise use this answer for a server workspace: http://stackoverflow.com/questions/31967775/excluding-files-from-tfs-server-workspace – janpieter_z Dec 28 '15 at 17:30
  • I have a local workspace. I can edit without an internet connection. Also, under manage workspaces -> advanced it says the location is local. – Don Chambers Dec 28 '15 at 17:51
  • Alright. Mind sharing your main, top repository level .tfignore? And if you currently have more the other ones as well, including your repository folder layout so we can easily see where your wwwroot is located from your main? It should then be solvable by simply adding a line in your .tfignore, but which line can sometimes be a bit tricky. – janpieter_z Dec 28 '15 at 18:09
  • Thanks. I updated my original post with that information. – Don Chambers Dec 28 '15 at 20:02
  • Thanks! Could you give it a shot by trying this in your solution level .tfignore: \Angular2Client\wwwroot\node_modules – janpieter_z Dec 29 '15 at 07:46
  • That did not work. I deleted the node_modules folder and let gulp put it back. It shows in pending changes. Incidentally, the \packages entry stops TFS from seeing the packages folder in other projects even though I don't use the project name in the path. – Don Chambers Dec 29 '15 at 17:14

1 Answers1

1

Assuming you are using ASP.NET 5 RC1, it seems this is a known issue with ASP.NET 5 RC1, will be fixed in RC2:

https://github.com/aspnet/Tooling/issues/289

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • This wasn't fixed in RC2, but is rather an issue with the TFS/VS component in Visual Studio, and is tentatively slated to be released with VS2015 Update 3, which doesn't have a release date that I can see as of this comment's submission. https://github.com/aspnet/Tooling/issues/18 – uxp May 23 '16 at 19:38