代码之家  ›  专栏  ›  技术社区  ›  Ido Ran

Visual Studio 2015无法加载包,因为Microsoft。VisualStudio。壳15.0未能加载

  •  6
  • Ido Ran  · 技术社区  · 9 年前

    当我在VS 2015上安装它时,我收到一条错误消息,说它无法加载我的软件包。在visual studio中 ActivityLog.xml

    如何使VS 2015和2017都能运行扩展?

    CreateInstance failed for package [MainWindowPackage]
    Source: 'mscorlib' 
    Description: Could not load file or assembly 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 
    
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 
    
    File name: 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo) at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName) 
    
    2 回复  |  直到 9 年前
        1
  •  5
  •   Weiwei    9 年前

    根据错误消息,您的扩展依赖于Microsoft。VisualStudio。壳15.0,这是VS 2017大会。因此,它不包含在您的VS 2015中。

    支持VSPackage并对其进行编程,以适应其运行的Visual Studio版本。您可以阅读此文档: https://docs.microsoft.com/en-us/visualstudio/extensibility/choosing-between-shared-and-versioned-vspackages

    Supporting Multiple Versions of Visual Studio .

        2
  •  2
  •   Sergey Vlasov    9 年前

    您应该参考Microsoft。VisualStudio。壳 14