- Update SKILL.md with comprehensive WebAPI documentation:
- New architecture diagram showing WebAPI middleware
- Complete REST API endpoints documentation
- WebAPI usage examples and best practices
- Instance discovery and multi-client support
- History tracking features
- Updated troubleshooting guide
- Update settings.local.json:
- Add auto-approval for WebAPI startup commands
- Add auto-approval for common build and test commands
- Streamline development workflow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add RoslynBridge.WebApi - ASP.NET Core 8.0 middleware that:
- Provides a centralized REST API for accessing multiple VS instances
- Manages instance registry with discovery by port, solution, or PID
- Proxies requests to the appropriate VS instance
- Tracks request/response history for debugging
- Auto-cleanup of stale instances via background service
Features:
- Health endpoints: /api/health, /api/health/ping
- Roslyn endpoints: /api/roslyn/projects, /api/roslyn/diagnostics, etc.
- Instance management: /api/instances (register, heartbeat, unregister)
- History tracking: /api/history, /api/history/stats
- Swagger UI at root (/) for API documentation
- CORS enabled for web applications
Services:
- InstanceRegistryService: Thread-safe registry of VS instances
- HistoryService: In-memory request/response history (max 1000 entries)
- InstanceCleanupService: Background service to remove stale instances
- RoslynBridgeClient: HTTP client for proxying to VS instances
Update RoslynBridge.sln to include RoslynBridge.WebApi project.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create RegistrationService to register VS instances with WebAPI
- Registers on startup with: port, process ID, solution info
- Reads WebApiUrl from ConfigurationService
- Sends heartbeat every N seconds (configurable)
- Unregisters on shutdown
- Gracefully handles registration failures (VS extension works standalone)
- Update RoslynBridgePackage to use RegistrationService
- Creates BridgeServer and gets actual port used
- Registers with WebAPI using discovered port
- Cleans up registration on disposal
This enables the WebAPI middleware to discover and route requests to
the correct Visual Studio instance based on solution path, port, or PID.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update BridgeServer to try multiple ports sequentially
- Reads DefaultPort and MaxPortRange from ConfigurationService
- Tries ports from DefaultPort to DefaultPort+MaxPortRange
- Updates _port field to the port that successfully starts
- Throws exception if no available ports found
- Make _port field mutable to store discovered port
- Add public Port property to expose the actual port being used
- Make startPort parameter optional (nullable), defaults to config value
- Add WriteRawResponseAsync helper method for future use
This allows multiple Visual Studio instances to run simultaneously,
each with their own Roslyn Bridge server on different ports.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add appsettings.json with configurable settings:
- WebApiUrl: URL of the WebAPI middleware (default: http://localhost:5001)
- DefaultPort: Starting port for VS instances (default: 59123)
- MaxPortRange: Number of ports to try (default: 10)
- HeartbeatIntervalSeconds: Heartbeat interval (default: 60)
- Create ConfigurationService singleton to load settings
- Loads from appsettings.json in extension directory
- Falls back to sensible defaults if file missing
- Provides easy property access
- Update RoslynBridge.csproj to include:
- ConfigurationService.cs in compilation
- appsettings.json as content (copied to output and included in VSIX)
- System.Data reference for future use
This allows users to customize extension behavior without recompiling.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>