AnkhSVN icon indicating copy to clipboard operation
AnkhSVN copied to clipboard

Exception in Visual Studio 2022 (version 17.2.0) when opening a solution that uses AnhSvn

Open BrightLight opened this issue 2 years ago • 10 comments

I've successfully used AnkhSVN version 2.9.87 with Visual Studio 2022 (internal version < 17.2). Now I've updated to VS2022 version 17.2. When I now open a solution file that uses AnkhSvn I get this exception:

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)

Afterwards Visual Studio freezes.

BrightLight avatar May 13 '22 15:05 BrightLight

I am receiving the same error, but I'm able to continue working and even Ankh seems to be working ok.

arsjones avatar May 13 '22 16:05 arsjones

Additionally i get a message that "One or more project in the solution were not loaded correctly". But I cannot an unloaded project though. In the output window from "Solution" i get the message: "Some of the properties associated with the solution could not be read."

I am not sure if this is related to AnkhSVN.

hgbutte avatar May 17 '22 07:05 hgbutte

I rebuilt the package with latest Microsoft.VisualStudio.OLE.Interop package and that seem to solve the issue.

mxtmra avatar May 17 '22 08:05 mxtmra

This appears to be the same issue as https://github.com/AmpScm/AnkhSVN/issues/44

RincewindTVD avatar May 18 '22 22:05 RincewindTVD

After reading #44 I tried the vsix from the MSBuild 121 action and can confirm that I no longer get the exception.

BrightLight avatar May 19 '22 11:05 BrightLight

Yes, after #44 now is working, thanks

Julimuz avatar May 19 '22 17:05 Julimuz