Problem:
When trying to check in a change to my Visual Studio project, the message appears that the context is invalid and must be reset. Going into the "Edit Context" window, no package is selected, and the drop down selection box is disabled, so no package can be chosen. Since the context definition is incomplete, the "OK" button is disabled and the only option available is to cancel.
Environment:
CA Harvest SCM 12.x with Visual Studio 20xx and Visual Studio Plugin
Cause:
When looking at the project in the Visual Studio IDE, we found that the "Checked Out" glyph appeared next to the project's solution file. The project had just then been opened from source control and no changes to any of the files in the project had been made, so no "Checked out" glyph should have been present. In Workbench the project's solution file showed as "N"ormal status, and not "R"eserved (checked out). Looking more closely at the project folder in Workbench, we found that the ".cascm" folder had been checked in along with the rest of the project files. Since the ".cascm" folder contains information needed by CA Harvest SCM to maintain the connection between the Harvest Repository and the Visual Studio project, and is meant to be temporary in nature, this folder should never be checked in along with the rest of the Visual Studio project files. In this case, the ".cascm" folder contained some stale information about the state of the Visual Studio project, causing the Harvest repository and the Visual Studio project status to be out of synch.
Resolution:
The solution involves eliminating the ".cascm" folder and any files contained inside it from the Harvest repository. There are 2 ways you might accomplish this:
For this particular case the choice was made to demote the .cascm folder back to the originating state and delete it. Using Workbench and the Administrator Tool we performed the following steps:
After this we refreshed the Visual Studio project on the developer's computer by deleting all the contents of the local project folder and performing "Open the solution from source control" in Visual Studio. This time the solution file did now show the "checked out" glyph and the context could be edited as needed.