5

In my project I have a WCF service reference. The service reference generates some metadata files that have an extension .datasource. I want to ignore/exclude in the tfignore all those files that end with this extension (.datasource) in the folder that contains the service reference.

For some reason VS2017 still shows in my pending changes all the excluded files with the extension .datasource. However, what is strange is that all other files other than this extension do get ignored/excluded. There is one thing of interest though that for the .datasource exclude rule that I have in tfignore, the path consists of a folder/directory that has a space in its name.

Here is that rule in tfignore:

My FolderName/Web.datasource

Is the space in the rule causing the issues? or is it something else?

Gagan
  • 305
  • 1
  • 13
  • Did that folder has whitespace in the middle, head or end? Could not judge this info from your original post `\src\Shared\SharedTaskReference\TaskReference\Service References\NecTaskReference*.datasource` – PatrickLu-MSFT May 08 '18 at 08:24
  • There was a space infact but it was hard to visualize, I simplified the example rule, it must be more readable now – Gagan May 09 '18 at 19:21

1 Answers1

2

This .tfignore file will not affect with those files already in source control. You need to remove them from source control first.

Besides if those files already in the pending changes before you add your .tfigonre file in source control. You can try below solution:

If the changes are "still" in pending changes, first create a backup copy, then make an Undo on them. Close VS, restore the backup copies and then it should work.

Since .tfignore is similar to .gitignore, if there are space in the middle of folder name, such as My FolderName/Web.datasource, give a try with below format:

My\ FolderName/Web.datasource

For more detail info of .tfignore file rules please refer the official tutorial.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thanks alot @PatrickLu-MSFT, adding a slash before the space in the folder name made it work. Now Visual studio detects & excludes all the .datasource files automatically. – Gagan May 08 '18 at 13:28