Technical reference for DotNET Build Buddy extension components.
Main class for managing .NET project files.
Generates a solution file (Solution.sln) containing all discovered projects.
Returns: Promise that resolves when solution file is generated
Throws: Error if workspace folder not found or generation fails
Updates all project files based on current source files in the workspace.
Process:
- Finds all source files (.cs, .fs, .vb)
- Groups files by directory and type
- Creates/updates appropriate project files
- Checks NuGet compatibility
- Updates inline diagnostics
Returns: Promise that resolves when all projects are updated
Updates both project files and solution file.
Returns: Promise that resolves when both operations complete
Class for checking NuGet package compatibility.
checkCompatibility(packageName: string, packageVersion: string | undefined, targetFramework: string): Promise<CompatibilityIssue | null>
Checks if a package is compatible with a target framework.
Parameters:
packageName: Name of the NuGet packagepackageVersion: Version of the package (optional)targetFramework: Target framework (e.g., "net8.0")
Returns: Promise resolving to compatibility issue or null if compatible
checkProjectCompatibility(packageReferences: Array<{ Include: string; Version?: string }>, targetFramework: string): Promise<CompatibilityIssue[]>
Checks compatibility for all packages in a project.
Parameters:
packageReferences: Array of package referencestargetFramework: Target framework
Returns: Promise resolving to array of compatibility issues
Enhanced compatibility check with suggestions.
Returns: Promise resolving to enhanced issues with suggestions
suggestFrameworkUpgrade(targetFramework: string, packageReferences: Array<{ Include: string; Version?: string }>): Promise<{ suggestedFramework: string; reason: string; packagesSupporting: string[] } | null>
Suggests framework upgrade if appropriate.
Returns: Promise resolving to upgrade suggestion or null
Clears the compatibility check cache.
Class for providing inline diagnostics in VS Code.
Updates inline diagnostics for a project file.
Parameters:
projectFile: Path to the project fileissues: Array of enhanced compatibility issues
Returns: Promise that resolves when diagnostics are updated
Clears all diagnostics.
Disposes the diagnostic collection.
Class for monitoring file system changes.
Disposes all file watchers and timers.
interface CompatibilityIssue {
packageName: string;
packageVersion?: string;
targetFramework: string;
issueType: 'incompatible' | 'version_mismatch' | 'deprecated';
message: string;
recommendation?: string;
}interface EnhancedCompatibilityIssue extends CompatibilityIssue {
suggestedVersion?: string;
alternativePackage?: {
name: string;
version?: string;
reason?: string;
};
transitiveIssues?: Array<{
packageName: string;
version?: string;
message: string;
}>;
}interface ProjectInfo {
targetFramework?: string;
targetFrameworks?: string[];
nullable?: string;
rootNamespace?: string;
sdk?: string;
customProperties?: Record<string, string>;
packageReferences?: Array<{ Include: string; Version?: string }>;
}interface DotNetVersionInfo {
type: 'net' | 'netcoreapp' | 'netframework' | 'netstandard';
version?: string;
fullTargetFramework: string;
}Manually generate a solution file.
Usage: Command Palette → "DotNET Build Buddy: Generate Solution File"
Manually update all project files.
Usage: Command Palette → "DotNET Build Buddy: Update Project Files"
Refresh both projects and solution.
Usage: Command Palette → "DotNET Build Buddy: Refresh All .NET Files"
The extension monitors:
- Source file changes (
.cs,.fs,.vb) - Project file changes (
.csproj,.fsproj,.vbproj) - Solution file changes (
.sln)
Extension activates when workspace contains:
**/*.csfiles**/*.fsfiles**/*.vbfiles**/*.csprojfiles**/*.fsprojfiles**/*.vbprojfiles**/*.slnfiles
All settings are accessed via VS Code's configuration API:
const config = vscode.workspace.getConfiguration('dotnetBuildBuddy');
const autoUpdate = config.get<boolean>('autoUpdate', true);Diagnostics are provided via VS Code's DiagnosticCollection:
const collection = vscode.languages.createDiagnosticCollection('dotnetBuildBuddy');
collection.set(document.uri, diagnostics);The extension integrates with NuGet.org API:
- Base URL:
https://api.nuget.org/v3-flatcontainer/ - Package Index:
/{packageId}/index.json - Package Metadata:
/{packageId}/{version}/{packageId}.nuspec
Registered in package.json:
dotnetBuildBuddy.generateSolutiondotnetBuildBuddy.updateProjectsdotnetBuildBuddy.refreshAll
Defined in package.json:
- All
dotnetBuildBuddy.*settings
Defined in package.json:
- File pattern-based activation
All methods include error handling:
- Network errors: Falls back to local rules
- Parse errors: Logged and reported to user
- File system errors: Logged with warnings
- API errors: Gracefully handled with fallback
- Compatibility checks are cached
- Cache expiry is configurable
- Cache key:
{package}|{version}|{framework}
- File changes are debounced (1 second default)
- Prevents excessive updates
- Improves performance
- All operations are asynchronous
- Non-blocking UI updates
- Concurrent processing where possible
Extension logs to VS Code console:
- Activation messages
- File change detections
- Compatibility check results
- Errors and warnings
Access via: View → Output → Select "DotNET Build Buddy"