Go To Definition Using Language Server Protocol throws System.IO.FileNotFoundException HResult=0x80070002 Message=Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its

Shilpalakshmi Mithur 0 Reputation points
2023-12-08T03:59:37.2433333+00:00

Hi , i am developing VS extension using Language Server protocol for custom language .And i am referring https://github.com/tgjones/HlslTools/tree/master for developing. But when i click Go To definition i am getting error

System.IO.FileNotFoundException
  HResult=0x80070002
  Message=Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,205 questions
Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
228 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 29,836 Reputation points Microsoft Vendor
    2023-12-08T10:15:36.0833333+00:00

    Hi @Shilpalakshmi Mithur

    Welcome to Microsoft Q&A! 

    Are you using VS2019 or VS2022? Please update it to the latest version. 

    From the error message, it may be caused by missing the NuGet package Microsoft.CodeAnalysis or its dependencies. 

    Please ensure that the version of the referenced ‘Microsoft.CodeAnalysis’ package is 4.1.0.  

    Or you can try to reinstall the NuGet package with version 4.1.0.

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

     


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.