Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing Microsoft.VisualStudio.Component.CoreEditor when installing Visual Studio extension

I am trying to get scrcpy to run in Visual Studio by using this extension and determine if I can extend its features.

Unable to install a VSIX extension for Visual Studio 2019

Installation fails indicating:

enter image description here

I updated the <InstallationTarget> and <Dependency> as per here,

You need to change InstallationTarget to [15.0,17.0) and Prerequisite to [15.8.27729.1,).

I unzipped the .vsix file, updated the extension.vsixmanifest file to the following:

<Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,17.0)" />
  </Installation>
  <Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" Version="[4.5,)" />
    <Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" Version="[15.0]" />
  </Dependencies>
  <Prerequisites>
    <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.8.27729.1,)" DisplayName="Visual Studio core editor" />
  </Prerequisites>

Zipped the directory, renamed to *.vsix, tried to install again.

The installer now recognizes Visual Studio 2019, begins installing but fails, missing Microsoft.VisualStudio.Component.CoreEditor.

12/11/2019 5:25:00 PM - Beginning to install extension to Visual Studio Enterprise 2019 (2)...
12/11/2019 5:25:02 PM - Install Error : Microsoft.VisualStudio.ExtensionManager.MissingReferencesException: This extension cannot be installed because the following references are missing:
-Microsoft.VisualStudio.Component.CoreEditor (Microsoft.VisualStudio.Component.CoreEditor)
   at Microsoft.VisualStudio.ExtensionManager.EngineUtilities.EnsureNoMissingReferences(IEnumerable`1 missingRefs)
   at Microsoft.VisualStudio.ExtensionManager.PackageInstaller.PrepareEngineInstall(IDependencyGraph dGraph, IDependencyComparisonSeed seed, Component vsixComponent, Boolean isProductComponent, Int32& totalInstallationSteps)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.PerformSetupEngineInstall(InstallableExtensionImpl extension, Boolean installPerMachine, Boolean isPackComponent, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, IProgress`1 progress, InstallFlags installFlags, AsyncOperation asyncOp, Version targetedVsVersion, IInstalledExtension& newExtension)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallInternal(InstallableExtensionImpl extension, InstallFlags installFlags, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, AsyncOperation asyncOp, IProgress`1 progress, Version targetedVsVersion)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.BeginInstall(IInstallableExtension installableExtension, InstallFlags installFlags, AsyncOperation asyncOp, Version targetedVsVersion)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallWorker(IInstallableExtension extension, InstallFlags installFlags, AsyncOperation asyncOp)

Suggestions on next steps please?

like image 342
ElHaix Avatar asked Dec 11 '19 22:12

ElHaix


4 Answers

Missing Microsoft.VisualStudio.Component.CoreEditor when installing Visual Studio extension

l think the main issue is that you did not modify the version of Microsoft.VisualStudio.Component.CoreEditorto support Visual Studio 2019 in catalog.json file. So when you run the vsix file, it will monitor and then run the file is missing the corresponding VS2019 Microsoft.VisualStudio.Com ponent. CoreEditor.

Solution

Apart from the changes to extension.vsixmanifest file, please also change "Microsoft.VisualStudio.Component.CoreEditor":"[15.0,16.0)" in catalog.json file to [15.0,17.0).

Hope it could help you.

like image 104
Mr Qian Avatar answered Oct 16 '22 16:10

Mr Qian


Update for VS2022 to enable installation you have to modify extension.vsixmanifest

<Installation>
   <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,17.0)">
      <ProductArchitecture>x86</ProductArchitecture>
   </InstallationTarget>
   <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
      <ProductArchitecture>amd64</ProductArchitecture>
   </InstallationTarget>
</Installation>

As Perry Qian-MSFT said when using older vsix packages on newer Visual studio you should update [14.0,16.0] to whatever is the current VS version [14.0,xx.x].

Within files

  • catalog.json
  • manifest.json
  • extension.vsixmanifest
like image 45
Tomaž Šuen Avatar answered Oct 16 '22 17:10

Tomaž Šuen


As an alternative, you may want to modify the Visual Studio Installation (with Visual Studio Installer) and include the "Visual Studio extension development". Odds are, this toolset will fix the missing requirement issue. Visual Studio Installer Toolset

like image 7
Carlos Casalicchio Avatar answered Oct 16 '22 17:10

Carlos Casalicchio


For VS2022 you need to edit the version string to [17.0,18.0) as in:

Microsoft.VisualStudio.Component.CoreEditor": "[17.0,18.0)"

like image 2
silkfire Avatar answered Oct 16 '22 18:10

silkfire