locked
[VS 2019 RTM extension - ROSLYN - VSIX] Microsoft.VisualStudio.Components.Roslyn.LanguageServices dependency is missing RRS feed

  • Question

  • Hi,
    my extension is analyzer and code fix based on Roslyn.

    VSIX declares the dependency on the Roslyn Language Services ([15.0,16.0)).

    The extension is successfully installed in VS 2017.

    VS 2019 (both RC & RTM) throws.

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

    If I remove the dependency from the manifest, then the extension is installed and works. I think that my installation of the VS 2019 has all required dependencies. I am reluctant to release a new version without explicit dependency to the public for obvious reasons - if the target visual studio does not have required dependency, then the extension will be installed and it will silently fail.

    Github issue: https://github.com/renestein/ConfigureAwaitEnforcer/issues/2 

    Other developers experience the same problem. E. g.
    https://github.com/Microsoft/RoslynClrHeapAllocationAnalyzer/issues/68

    Is this a known bug? Would you mind to suggest some workaround?
    Thanks for your assistance.


    http://blog.renestein.net







    • Edited by Rene Stein Thursday, April 4, 2019 10:08 PM
    Thursday, April 4, 2019 8:08 PM

Answers

  • I have discovered the solution myself.
    To support both VS 2017 and VS 2019 declare the dependency:
            <Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0.25904.2,)" DisplayName="C# and Visual Basic" />
    HTH

    http://blog.renestein.net Twitter: renestein

    • Proposed as answer by oudiyue Friday, May 31, 2019 2:11 PM
    • Marked as answer by Rene Stein Friday, May 31, 2019 8:12 PM
    Thursday, April 4, 2019 9:48 PM

All replies

  • I have discovered the solution myself.
    To support both VS 2017 and VS 2019 declare the dependency:
            <Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0.25904.2,)" DisplayName="C# and Visual Basic" />
    HTH

    http://blog.renestein.net Twitter: renestein

    • Proposed as answer by oudiyue Friday, May 31, 2019 2:11 PM
    • Marked as answer by Rene Stein Friday, May 31, 2019 8:12 PM
    Thursday, April 4, 2019 9:48 PM
  • Hi Rene,

    Welcome to MSDN forum.

    To install an extension successfully, we must meet its prerequisites.

    In your situation, If you set Roslyn Language Services as [15.0,16.0), it means the vsix is only for vs version 15.0 and 15.X(VS2017--15.x), not for vs version 16.0 and above (VS2019--16.0 and 16.x)

    So the extension can only be installed successfully in VS2017 on your side. When it changes to [15.0.25904.2,), it means it's for vs2017 and all vs versions higher than it. (VS2017,VS2019,VS202X)

    And many thanks for your sharing solution and update, you can mark it as answer which benefit others with similar issue.

    Have a nice day:)

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 5, 2019 1:49 AM
  • Hi Lance-Li,

    thanks for your answer. I would like to point out that the new default template for Roslyn analyzer in the VS 2019 RTM has the same problem. I know about the VS version policy, but this bug (?) is very confusing.

    To be precise.
    Following are default dependencies in VS 2019 RTM.

     <Prerequisites>
        <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
        <Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0,16.0)" DisplayName="Roslyn Language Services" />

    I think that this is a bug. Could you please raise the issue?
    Best regards

    Rene


    http://blog.renestein.net Twitter: renestein




    • Edited by Rene Stein Friday, April 5, 2019 5:29 PM
    Friday, April 5, 2019 5:22 PM
  • Hi Rene,

    Thanks for your feedback. I fail to reproduce same issue on my side. If I create a new vsix project in VS2019 preview, the prerequisites is like [16.0,17.0) .

    >>the new default template for Roslyn analyzer in the VS 2019 RTM has the same problem

    Do you download this SDK? This sdk seems to only support for vs2015 and vs2017(It can't be installed in vs2019), so we can only create new analyzer with codefix project in vs2017 not vs2019. And in vs2017, the [15.0,16.0) is suitable. 

    Please check if you can create new analyzer with codefix project in vs2019(update it to latest version). As for know, after my check. This template seems to not support for vs2019, some users have report the question here.

    Best regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 8, 2019 9:17 AM