How to keep VS2015 NuGet from adding packages to TFS

前端 未结 3 600
面向向阳花
面向向阳花 2020-12-07 23:18

VS2013 had a bug where NuGet would add packages as pending changes, even if you told it not to with .tfignore. There was a workaround, but it doesn\'t work with

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 23:45

    In your %AppData%\NuGet\NuGet.Config file, add the following just before the XML tag...

    
      
    
    
      
    
    

    ...you can specify any path you want - the important thing is putting it OUTSIDE your TFS workspace!

    Now you never have to worry about that stuff again. Your solution folder will not contain any packages anymore; all solutions will default to using your custom packages location instead.

    NOTE - This works is on a per-user basis.

    Until now, I've been doing the same in a one-config-per-solution (\.nuget\NuGet.Config) manner. Thanks to @dsghi for the insight!

    Make sure your solution folder does not contain a .nuget folder (old way of doing things). Even if the folder is NOT included in the solution and only in the file system, it will override everything!

提交回复
热议问题