【问题标题】:AnkhSVN Error in Visual Studio 2022 17.2.5Visual Studio 2022 17.2.5 中的 AnkhSVN 错误
【发布时间】:2022-08-15 13:17:15
【问题描述】:

将 Visual Studio 更新到最新版本 AnkhSVN 后,在加载解决方案时显示此错误:

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)

任何帮助将不胜感激

    标签: ankhsvn


    【解决方案1】:

    在解决方案文件中,尝试删除下面定义对 Ankhsvn 的依赖关系的 GlobalSection:

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

    这适用于我在以前版本的 Visual Studio 中创建的旧解决方案。

    【讨论】:

    • 我已经按照您的指导更改了解决方案,并且发生了另一个错误The source control provider associated with this solution could not be found. The projects will be treated as not under source control. Do you want to permanently remove the source bindings from the projects? Yes/No 我说是并且 .csproj 文件更改为: <SccProjectName></SccProjectName> <SccLocalPath></SccLocalPath> <SccAuxPath></SccAuxPath> <SccProvider ></SccProvider> 最后,重新加载解决方案没有错误。但是解决方案仍然在源代码控制上吗?
    • @Hamedb 嗨,您的解决方案似乎不再受源代码控制。你也不应该看到任何 Ankh svn 图标。
    【解决方案2】:

    此问题已在此扩展的新版本中得到解决。 这个 Visual Studio 扩展的开发者不会在 Visual Studio 市场上发布它的开发,而是在 Gihub 上发布。
    这是它的 Github 项目的地址:
    https://github.com/AmpScm/AnkhSVN
    This help 了解如何为像我这样刚接触 Github 的人下载可安装版本

    【讨论】:

      猜你喜欢
      • 2021-09-03
      • 2022-10-30
      • 1970-01-01
      • 2022-07-13
      • 1970-01-01
      • 2022-08-19
      • 2022-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多