How to make a project compatible with VS source control integration
The following are the necessary mininum steps required to integrate a new project type with source control within Visual Studio.
- The project must implement Microsoft.VisualStudio.Shell.Interop.IVsSccProject2 (documentation).
- GetSccFiles - return which files are controllable for the given item ID
- GetSccSpecialFiles - return hidden files for the given item ID
- SetSccLocation - persist the SCC settings to the project file
- SccGlyphChange - notifies project that changes have been made to the indicated items' SCC glyphs
- The project must utilize Microsoft.VisualStudio.Shell.Interop.IVsSccManager2 (documentation).
- RegisterSccProject - call when the project is opened
- UnregisterSccProject - call when the project is closed
- GetSccGlyphs - call to get source control glyphs and source control status
- The project must utilize Microsoft.VisualStudio.Shell.Interop.IVsQueryEditQuerySave2 (documentation).
- QueryEditFiles - call before editing a file in the project to notify listeners (e.g. SCC)
- QuerySaveFiles - call before saving a file in the project to notify listeners (e.g. SCC)
- The project must utilize Microsoft.VisualStudio.Shell.Interop.IVsTrackProjectDocuments2 (documentation)
- OnQuery* - call before attempting the add/rename/move/etc. operation to notify listeners (e.g. SCC) and to give listeners the chance to veto the attempt.
- OnAfter* - call after the operation has been performed to permit listeners (e.g. SCC) to perform related operations (e.g. pend an SCC add).
- To permit SCC commands to show in the context menus, the menu should contain the following groups:
- guidSHLMainMenu::IDG_VS_CTXT_SOLUTION_SCC
- guidSHLMainMenu::IDG_VS_CTXT_PROJECT_SCC
- guidSHLMainMenu::IDG_VS_CTXT_ITEM_SCC