Home > OS >  Cannot install an extension in Visual Studio 2019 due to missing references
Cannot install an extension in Visual Studio 2019 due to missing references

Time:09-21

How do I fix these issues? Where do I need to download?

C# Code Analyzer (Roslyn)

This extension cannot be installed because the following references are missing: Microsoft.VisualStudio.Component.Roslyn.Compiler

ErrorProne.NET.Structs

This extension cannot be installed because the following references are missing: Microsoft.VisualStudio.Component.CoreEditor Microsoft.VisualStudio.Component.Roslyn.LanguageService

enter image description here

CodePudding user response:

This is a known problem with both extensions and VS2019.

  • Roslyn has a fix with versions 2.0 and there is also a work-around that you might try.
  • ErrorProne has a possible fix in its GitHub but it does not look to be release as an extension. There is a work-around submitted by a user.

For Roslyn, if the new extension does not work, declare the dependency in extension.vsixmanifest and/or catalog.json.

<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0.25904.2,)" DisplayName="C# and Visual Basic" />

For ErrorProne, try to add the following to a Directory.Build.props file:

<Project>
  <ItemGroup>
    <PackageReference Include="ErrorProne.NET.Structs" Version="0.3.0-beta.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
    </PackageReference>
  </ItemGroup>
</Project>

Another ErrorProne work-around is to download the vsix from marketplace and modify two files: extension.vsixmanifest and catalog.jsonby replacing [15.0,16.0) with [15.0,17.0)

CodePudding user response:

This should be an issue from the extension itself(some configurations not set, some prerequisites not add…). As you can see, the C# Code Analyzer (Roslyn) extension => last updated 4/8/2017, and the ErrorProne.NET.Structs extension => last updated 5/3/2018.

Solution should be from extension side, and need to be fixed by author. Instead, you may try to install and use NuGet packages, NuGet packages seem work well. NuGet package for C# Code Analyzer (Roslyn)/UDNZ.Roslyn.Analyzer, and ErrorProne.NET.Structs.

  • Related