Visual Studio provides the most complete Metalama experience. All features work out of the box once you install the Metalama Tools extension.
Installing Metalama Tools for Visual Studio
The Metalama Tools extension adds several IDE features:
- CodeLens: Shows aspect information directly in the editor
- Diff preview: Visualize how aspects transform your code
- Live templates: Apply aspects that modify source code directly
- Code fixes and refactorings: Apply aspects through the lightbulb menu
For installation instructions, see Installing Visual Studio Tools for Metalama.
Recommended settings
Disabling lightweight solution load for large solutions
If you have a large solution with many projects using Metalama, consider disabling lightweight solution load to ensure all projects are fully loaded and analyzed:
- Open Tools > Options > Projects and Solutions > General.
- Clear the Load projects in lightweight mode checkbox.
Configuring source link for debugging
To step into Metalama source code when debugging:
- Open Tools > Options > Debugging > General.
- Select the Enable Source Link support checkbox.
- Clear the Enable Just My Code checkbox.
Troubleshooting
Extension not loading
If the Metalama Tools extension isn't working:
- Verify the extension is installed: Extensions > Manage Extensions > Installed.
- Check the extension is enabled for your Visual Studio instance.
- Try restarting Visual Studio.
- Check the Activity Log for errors: run
devenv /logand review%APPDATA%\Microsoft\VisualStudio\<version>\ActivityLog.xml.
CodeLens not showing
If CodeLens information isn't appearing:
- Verify CodeLens is enabled: Tools > Options > Text Editor > All Languages > CodeLens.
- Check that Show Metalama CodeLens is enabled.
- Ensure the file is part of a project with Metalama enabled.