Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Dot Run FilesNew to Visual Studio Code? Get it now.
Dot Run Files

Dot Run Files

yutat23

|
1 install
| (0) | Free
Run C# file-based apps with arguments, history, and restart controls.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dot Run Files

Japanese documentation: README.ja.md. Release notes: CHANGELOG.md and CHANGELOG.ja.md (Japanese).

Run C# file-based apps with .NET 10 or later directly from VS Code. Supports desktop VS Code on Windows, macOS, and Linux without relying on an OS-specific shell.

Installation

In the Extensions view, select … → Install from VSIX… and choose dot-run-files-0.1.1.vsix. .NET SDK 10 or later is required. If a global.json file applies, the extension checks the SDK selected by that file.

Usage

  • Right-click a .cs file and select Dot Run Files: Run C# File. You can also use the editor's ▶ button or Ctrl+Alt+R (Cmd+Alt+R on macOS).
  • Select Run C# File with Arguments… to enter arguments. Quote arguments containing spaces. Up to 10 history entries are kept per file.
  • Use Dot Run Files: Repeat Last Run in the Command Palette to reuse the last file and arguments. Current settings apply to each run.
  • Use Stop Running C# File… or the status bar to stop an app. Running an active file again offers a restart option.
  • The integrated terminal supports standard input and colored output. MSBuild-format errors appear in the Problems panel and link to source lines.

Run C# File always runs without arguments. Use Repeat Last Run to reuse arguments. Arguments are passed directly, without shell interpretation of |, >, or $(). Inside quotes, \" or \' escapes the matching quotation mark. Other backslashes remain literal.

Settings

Setting Default Description
dotRunFiles.saveBeforeRun true Save the target file before running.
dotRunFiles.workingDirectory file Choose file, workspace, or custom.
dotRunFiles.customWorkingDirectory Empty Custom directory. Relative paths resolve from the workspace folder, or the file's folder when no workspace is open.
dotRunFiles.dotnetPath dotnet Path to the dotnet executable.
dotRunFiles.environment {} Environment variables passed to the app.

Runs dotnet run --file <absolute path> -- <arguments>. The working directory defaults to the target file's folder. Workspace Trust is required. Debugging, publishing, and launch profile selection are not included in this version.

Development

npm install
npm run check
npm test
npm run build
npm run package

Open this folder in VS Code and press F5 to start the Extension Development Host. Try examples/hello.cs for arguments and examples/interactive.cs for standard input.

Validation status

TypeScript type checking, argument parsing tests, and command handling tests using a mocked VS Code API have passed. Arguments with spaces and Japanese text were verified on Windows with .NET SDK 10.0.301. NuGet access was restricted in the validation environment, so the sample was run with -p:PublishAot=false -p:NuGetAudit=false -p:RestoreIgnoreFailedSources=true. Normal execution requires access to packages the SDK needs to restore. macOS/Linux hardware testing and interactive VS Code UI testing have not yet been performed. A three-OS CI workflow is provided in .github/workflows/ci.yml.

Reference: File-based apps — Microsoft Learn

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft