C# Scripts
Use C# scripts when you want a short typed snippet without creating a full add-in project.
Entry suffix:
*script.csx
Example:
samples/CSharpScriptDemo/main_script.csx
NuGet References
Declare package references with Roslyn #r directives:
#r "nuget: Newtonsoft.Json, 13.0.3"
#r "C:/Program Files/Autodesk/Revit 2025/RevitAPI.dll"
#load "./Helpers/DocumentHelper.csx"
#r "nuget: …" resolves through the shared NuGet resolver (NugetManager). Packages restore under %APPDATA%\RevitDevTool\nuget. Host API paths can be rewritten by the host bridge.
#load pulls additional .csx files into the script graph. Each file can declare its own #r and #load directives.
Host Version Symbols
Scripts receive the same preprocessor symbols as host add-in projects (REVIT2025, REVIT2025_OR_GREATER, AUTOCAD2026, and so on) via CompileScriptSymbols. Use #if REVIT2025_OR_GREATER in .csx the same way you would in a compiled add-in.
Debugging
C# scripts compile with Debug emit and a portable PDB so an attached debugger can bind breakpoints to the original .csx source.
Workflow:
- Open the script folder in Visual Studio or VS Code (C# Dev Kit recommended).
- Set breakpoints in your
.csxfiles. - Attach the debugger to the running host process (
Revit.exe,acad.exe, …). - Run the script from RevitDevTool.

Placeholder — replace with a product screenshot.
For attach settings shared with F# scripts and assemblies, see Attach Debugger.
Samples
samples/CSharpScriptDemo/
samples/AcadCSharpDemo/ (AutoCAD-family)