Skip to content

Diagrams

Create and manage technical diagrams using the integrated Excalidraw whiteboard.

C# Dev Tools includes Excalidraw integration for creating diagrams, flowcharts, and technical illustrations directly in VS Code.

Stored in your user profile, available across all workspaces:

  • Reusable diagrams
  • Personal reference
  • Cross-project documentation
  • Architecture diagrams

Stored per workspace under .vscodecsdt/Diagrams at the workspace root:

  • Project-specific diagrams
  • Team collaboration – check the folder into source control to share with the team
  • Context-specific (architecture, flows, etc.)
  • Backward compatibility: existing diagrams from the previous global location (~/.vscode-csharp-dev-tools/diagrams/workspace/) are still readable and shown alongside new ones
  1. Open Solution Explorer
  2. Expand “Tools” → “Diagrams”
  3. Click “Create Global Diagram”
  4. Enter diagram name
  5. Diagram opens in Excalidraw
  1. Open Solution Explorer
  2. Expand “Tools” → “Diagrams”
  3. Click “Create Workspace Diagram”
  4. Enter diagram name
  5. Diagram opens in editor
  • Shapes: Rectangle, circle, diamond, ellipse
  • Lines: Straight, arrows, curves
  • Text: Labels and annotations
  • Freehand: Hand-drawn elements
  • Colors and fills
  • Stroke styles
  • Opacity
  • Font sizes
  • Line types
  • Grouping elements
  • Layers
  • Alignment tools
  • Distribution
  • Z-order management
  1. Expand “Diagrams” in Tools section
  2. View global and workspace diagrams
  3. Click to open
  4. Edits save automatically
  1. Right-click diagram in tree
  2. Select “Rename”
  3. Enter new name
  4. File is renamed
  1. Right-click diagram in tree
  2. Select “Delete”
  3. Confirm deletion
  4. File is removed

Export diagrams in various formats:

  • PNG: Raster image
  • SVG: Vector graphics
  • JSON: Excalidraw format

To export:

  1. Open diagram
  2. Use Excalidraw export menu
  3. Choose format
  4. Save file

Workspace diagrams can be version controlled:

  • Stored in .vscodecsdt/Diagrams at the workspace root
  • JSON format for diffing
  • Commit with code changes
  • Share with team

Add to .gitignore if needed:

.vscodecsdt/Diagrams/
  • System architecture
  • Component diagrams
  • Deployment diagrams
  • Network topology
  • Process flows
  • Decision trees
  • Algorithm visualization
  • Workflow documentation
  • Class relationships
  • Inheritance hierarchies
  • Interface contracts
  • Design patterns
  • UI layouts
  • Screen flows
  • User journeys
  • Mockups

Share diagrams with team:

  1. Commit workspace diagrams to repo
  2. Export as PNG/SVG for docs
  3. Use global diagrams as templates
  4. Share JSON files directly

Establish conventions:

  • Naming patterns
  • Color schemes
  • Symbol meanings
  • Diagram types

Excalidraw supports:

  • Ctrl+Z: Undo
  • Ctrl+Y: Redo
  • Ctrl+D: Duplicate
  • Ctrl+G: Group
  • Arrow keys: Move elements
  • Double-click to add text
  • Hold Shift for straight lines
  • Alt+drag to duplicate
  • Ctrl+drag for constrained movement
  • Use layers for complex diagrams
  • Group related elements
  • Name elements for clarity
  • Use consistent colors
  • Keep diagrams focused and simple
  • Use clear labels
  • Maintain consistent style
  • Version control workspace diagrams
  • Export for documentation
  • Update diagrams with code changes

If diagram doesn’t open:

  1. Check file exists
  2. Verify file permissions
  3. Try creating new diagram
  4. Check VS Code output for errors

If save fails:

  1. Check disk space
  2. Verify write permissions
  3. Check file isn’t locked
  4. Try exporting instead

If diagram appears corrupted:

  1. Check JSON file syntax
  2. Restore from version control
  3. Create new diagram
  4. Report issue if persistent