Reputation: 2875
With respect to Team Foundation Server's (TFS) source control... how do you change a project's status from Invalid
to Valid
?
We are in the process of reorganizing several solutions & projects in TFS. In this case:
In Visual Studio...
MyWorkspace
=> Edit... => Advanced
MySolution.sln
) in Notepad++GlobalSection(TeamFoundationVersionControl) = preSolution
SccProjectName
SccAuxPath
SccLocalPath
SccProvider
MySolution
in Solution ExplorerMySolution
and MyProject
are listed as Not Controlled
MySolution
and BindMyProject
is listed as Not Controlled
MyProject
and Bind
MyProject
is now marked as Invalid
Upvotes: 1
Views: 5321
Reputation: 742
I found two solutions:
Unbind, unload project then reload. Comes from Binding Invalid.
Delete the files that are not in source control. Comes from Solving the "Some projects have been bound to server locations that may be incorrect." in Visual Studio 2010 when using Team Foundation System 2010: When some percentage of Solution Items cannot be found locally, and are not in the version control system, Visual Studio marks the solution binding to the version control system as "Invalid".
For my case, it's because Angular build generate many files that I use .tfignore to stop them from being check-in. Visual Studio 2019 found "it does not contain the majority of the projects' files" and mark that project as "Invalid". After delete those files, it become "Valid" automatically. So the "Invalid" state is just a misleading/useless warning. You can just ignore that warning as nothing is really "invalid".
Upvotes: 0
Reputation: 1
I ran into the same problem a today. After trying different approaches, I found out, that two files in the current solution, was ignored (They were not added to TFS repo). In my case I had 2 custom ".config" files.
After adding these files manually, the status changed to 'Valid' and binding is now working.
Upvotes: 0
Reputation: 2875
Typically I avoid checking in code that is not [1] compile-able, and [2] ready for production (or at least ready for QA).
In this case, I decided to ignore my own rule and now I have paid the price :(
Although the projects location had been properly changed using the TFS Move
command, a few C++ projects had references pointing to the old paths. As a result, these projects had a Binding status of Invalid
:
MyProject
=> ThirdPartyLib
filter => HeaderOfSomeLibraryFile.h
MyProject.vcxproj
had an invalid project reference.
MyProject
=> Properties
=> Common Properties
=> References
After these problems had been corrected, the MyProject.vcxproj
binding status automatically switched to Valid
.
Upvotes: 0