AnkhSVN Error in Visual Studio 2022 17.2.5

2.8k views Asked by At

After upadting Visual Studio to Latest Version AnkhSVN show this error on loading solutions:

System.InvalidCastException: Unable to cast object of type 'Microsoft.VisualStudio.CommonIDE.Solutions.SolutionPropertyBag' to type 'Ankh.Scc.Native.ICOMPropertyBag'.
   at Ankh.VSPackage.AnkhSvnPackage.ReadSolutionProps(IVsHierarchy pHierarchy, String pszProjectName, String pszProjectMk, String pszKey, Int32 fPreLoad, IPropertyBag pPropBag)

Any Help will be appreciated

3

There are 3 answers

1
Ehsan Abidi On BEST ANSWER

This issue has been solved in new versions of this extension. The developper of this Visual Studio's extension do not publish it's developments on Visual Studio market but on Gihub.
here is the address on it`s Github project:
https://github.com/AmpScm/AnkhSVN
This one comment on top is help for how to download the installable file for persons new to Github like me

3
DaddyCool On

In the solution file, try to delete the below GlobalSection defining the dependency to Ankhsvn:

GlobalSection(SubversionScc) = preSolution
    Svn-Managed = True
    Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection

This worked in my older solutions, created in previous versions of Visual Studio.

0
Off The Gold On

For me, I ignored the error then added the solution to SVN. Upon closing the project it asked to save it, but say NO (otherwise I would get a save error). After that I was able to use the reopen and use the project without issue, including building/opening/closing the project and checking into SVN with no errors.