C# Language Server - Visual Studio Enhanced Fork

Enhanced by Zach Christmas | Original VS Code extension by Vytautas Survila
VS Code extension for the enhanced csharp-language-server with Visual Studio MSBuild support and lazy solution loading.
🚀 What's New in This Fork
Visual Studio MSBuild Support
- ✅ Automatic detection of Visual Studio Community/Professional installations
- ✅ Custom MSBuild path configuration in VS Code settings
- ✅ Environment variable integration for seamless setup
- ✅ Enhanced error handling for MSBuild issues
Lazy Solution Loading
- ⚡ On-demand loading - solutions load only when you open C# files
- 🚀 Faster startup - no more waiting for all solutions to load at once
- 🎯 Multi-solution support - perfect for large monorepos
- 🔄 Smart solution selection with command palette integration
📦 Installation
Prerequisites
Install the language server first:
dotnet tool install --global csharp-ls-vs
Install this extension from the VS Code marketplace
Requirements
- .NET 9.0 SDK or later
- Visual Studio Community/Professional (recommended)
- VS Code 1.80 or later
⚙️ Configuration
Basic Setup (Recommended)
{
"csharp-ls.csharp-ls-executable": "csharp-ls-vs",
"csharp-ls.msbuild.path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin"
}
Advanced Configuration
Setting |
Description |
Default |
csharp-ls.csharp-ls-executable |
Path to language server executable |
"csharp-ls-vs" |
csharp-ls.msbuild.path |
MSBuild directory path |
"" |
csharp-ls.msbuild.executable |
MSBuild executable path |
"" |
csharp-ls.trace.server |
LSP communication tracing |
{"verbosity": "off"} |
🎯 Usage
Automatic Solution Loading
- Open VS Code in your C# workspace
- Open any .cs file → Solution loads automatically via lazy loading
- IntelliSense activates with full project context
Manual Solution Selection
- Command Palette (
Ctrl+Shift+P )
- Type:
csharp-ls: Select solution or project
- Choose from available solutions
Multiple Solutions
- Each solution loads only when needed
- Switch between projects seamlessly
- No performance impact from unused solutions
✨ Features
- 🔍 Go to Definition (including decompiled metadata)
- 💡 IntelliSense & code completion
- 🏷️ Symbol search across projects
- 🔧 Code actions & refactoring
- 📝 Hover documentation
- ⚠️ Diagnostics & error reporting
- 🎨 Syntax highlighting via Roslyn
- 📁 Multi-solution workspaces
🛠️ Troubleshooting
Language Server Not Starting
- Verify installation:
dotnet tool list --global
- Check version:
csharp-ls-vs --version
- Review VS Code Output → "C# Language Server"
MSBuild Issues
- Ensure Visual Studio is installed
- Verify MSBuild path exists
- Configure custom path in settings if needed
- Check Output panel for specific errors
Solution Loading Problems
- Ensure .sln files exist in workspace
- Use "Select solution" command manually
- Check file permissions and paths
📄 Attribution & License
🙏 Original Work
This extension is a fork of outstanding work by:
🔧 Fork Enhancements
- Zach Christmas - Visual Studio MSBuild support and lazy loading integration
📋 License
MIT License (same as original projects)
⚠️ Support Notice
This is a fork with limited support.
Thank you to the original authors for their excellent foundation! 🎉
Enjoy enhanced C# development with Visual Studio MSBuild support! 🚀
| |