62mkv
62mkv

Reputation: 1522

How to exclude "packages" folder from Pending changes in VS2010+TFS2010

I'm desperate to fight against this problem: when I enable nuget on a solution and it grabs missing packages from web, it constantly tries to check-in them to TFS, although I definitely don't want it

There's a lot of advices on the web regarding this problem, but none has helped so far. I've done the setup according to this: http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages, tried to "cloak them" as it is recommended here: http://www.xavierdecoster.com/post/2011/10/17/tell-tfs-not-to-add-nuget-packages-to-source-control - all in vain. I'm stuck. Probably I lack some critical understanding of how does TFS client work with NuGet and VS 2010.

Any help is appreciated. Thanks!

Upvotes: 2

Views: 812

Answers (3)

SandRock
SandRock

Reputation: 5563

The only way I know is a little bit manual but can be automated at some point.

The big issue is the packages folders being overcrept. You can undo the packages in Visual Studio, the files won't be deleted. There is also a CLI for that:

C:\project\Main\packages> tf undo /recursive *

Do not use this command when you have pending changes on the repositories.config file.

You just need a little .bat file to check for pending changes (repositories.config file) and do the cleaning.

Upvotes: 1

GrahamD
GrahamD

Reputation: 304

Even cloaking the packages folder as DaveShaw suggests can still cause problems, especially when adding packages to large solutions. Best way I've found so far is to create another Visual Studio configuration...

devenv /RootSuffix NoTFS

and then delete the TFS provider for that configuration

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0NoTFS_Config\SourceControlProviders\{4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}

I'd suggest exporting that part of the registry before deleting and make sure you delete it from the NoTFS configuration.

After that you can run Visual Studio when you want without with TFS by starting it with the RootSuffix parameter above.

Upvotes: 0

DaveShaw
DaveShaw

Reputation: 52788

I've given up an any NuGet / Solution based approach to this problem.

I simply setup my workspace so that the packages are cloaked.

For example setting up your workspace like this means Packages is ignored by Source control:

Status    Server Path        Local Path
Active    $/TFS/             C:\Code
Cloaked   $/TFS/Packages

Upvotes: 0

Related Questions