How to open a .cs file
Quick, free ways to open C# on any system.
A .cs file is a C Sharp Source File. If double-clicking does nothing, your computer simply does not have an app that reads C# yet. Here is how to fix that on each operating system, using free software wherever possible.
Open a .cs file step by step
- Confirm the file really is a .cs. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
- On Windows, open it with Visual Studio or VS Code.
- On Mac, use VS Code or Rider.
- On Linux, try VS Code or Rider.
- Still stuck? Convert the .cs to dll, which opens more widely.
Best apps to open .cs files
Windows
- Visual Studio
- VS Code
- any text editor
macOS
- VS Code
- Rider
- any text editor
Linux
- VS Code
- Rider
- any text editor
!
Before you open it: Caution. A .cs file is program source. Building and running it executes its code; review unfamiliar files first.
Frequently asked questions
Why can't I open my .cs file?
Almost always because no installed app understands C#. Install one of the apps above, or convert the file to a format your existing software already reads.
How do I run a .cs file?
Inside a .NET project, dotnet run builds and runs it. Visual Studio and VS Code can build and debug C# directly.
Is C# only for Windows?
No longer. Modern .NET runs C# on Windows, macOS and Linux, and Unity uses it for games on many platforms.