105 words
1 minute

Troubleshooting C# IntelliSense in VS Code

2022-12-27
Views —

C# IntelliSense in VS Code kept stopping unexpectedly. In December 2022, I ran into another failure:

System.Composition.Hosting.CompositionFailedException: No export was found for the contract 'ILoggerFactory'

OmniSharp had updated automatically. In settings.json, I changed omnisharp.path from latest to a pinned version:

"omnisharp.path": "1.39.2",

Versions that worked together in this setup#

Automatic extension updates were a recurring source of problems in this project. This is the historical combination I found stable:

  • .NET Framework 4.7.1.
  • Unity’s VS Code package 1.2.0: set "com.unity.ide.vscode": "1.2.0" in manifest.json.
  • VS Code’s C# extension 1.24.0: use the arrow beside the uninstall button and choose Install Another Version.
  • OmniSharp 1.39.2: pin it with omnisharp.path in settings.json.

Default .NET Framework reference-assembly path#

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1

Troubleshooting C# IntelliSense in VS Code
https://blog.coding1024.com/en/posts/a421e405/
Author
huangjx
Published at
2022-12-27
License
CC BY-NC-SA 4.0

Comments

Questions, ideas and experiences are welcome. Please be kind and avoid sharing private information.

Loading comments…