How to open .CS files (C# source code) on Android, Windows and Linux
What .cs, .csproj, .sln, .vcxproj and .xaml files are and how to open and edit C# code and Visual Studio projects for free on Android, Windows and Linux.

Someone shares a Unity script called PlayerController.cs, or you unzip a .NET project and find a .sln, a .csproj and a pile of .cs files. Without Visual Studio, Windows doesn’t know what to do with them, and a phone knows even less.
All five of these are text. Folders opens them in its text editor on Android, Windows and Linux, so you can read the code, check what a project contains, and make small fixes without installing a development environment.
What is a .cs file?
A .cs file holds source code in C#, the language Microsoft introduced with its .NET platform around 2000. C# is used for Windows desktop apps, web services built with ASP.NET, and the scripts that drive games made in Unity. Like any source file, it does nothing until a compiler builds it into a program.
The other extensions here are the files Visual Studio keeps around that code:
| Extension | Language or format | What it’s for |
|---|---|---|
.cs |
C# | Source code: classes, methods, game scripts |
.csproj |
MSBuild project (XML) | One C# project: target framework, NuGet packages, build settings |
.sln |
Visual Studio solution | A list of projects that belong together, with build configurations |
.vcxproj |
MSBuild project (XML) | One C++ project in Visual Studio |
.xaml |
XAML (XML) | User interface layout for WPF, WinUI, UWP and .NET MAUI apps |
A modern .csproj is short. It names the target framework in a line like <TargetFramework>net8.0</TargetFramework> and lists each package as a <PackageReference>. A .vcxproj is the C++ equivalent and much longer, with settings for every build configuration.
The .sln file is the odd one out: not XML but Visual Studio’s own text format, with one Project(...) entry per project (its relative path and a GUID) and Global sections that pair projects with Debug and Release builds.
XAML (Extensible Application Markup Language) describes windows and controls as nested tags, such as a <Grid> holding a <Button>. A file like MainWindow.xaml usually has a partner, MainWindow.xaml.cs, with the C# code behind it.
How to open a .cs file with Folders
On Android
- Download Folders from the download section and install it. It runs on Android 7.0 and newer.
- On first launch, tap Allow access and switch on All files access, so Folders can see the folder where the project landed.
- Find the file by browsing, or search for its name.
- Tap it. Code, project and solution files all open in the same text editor.
Opening it from a chat or email? Tap the attachment and choose Open with → Folders. A project shared as a ZIP can be browsed in Folders like a folder, and any file in it opens with a tap.
On Windows and Linux
- Install Folders with the Windows installer, or one of the Linux packages (deb, rpm, AppImage, Flatpak, Snap or tar.gz).
- Find the project in Folders and double-click any file.
- On Windows you can also start from File Explorer: right-click the file, choose Open with → Folders. The installer adds Folders to that menu for the types it opens.
What you can do with it in Folders
- Read C# with highlighting.
.csfiles get colours for keywords, strings, numbers, comments and type names, with line numbers down the side. - Read project files as markup.
.csproj,.vcxprojand.xamlare highlighted as XML: tags, attribute names, values and comments each get their own colour. A.slnopens as plain text with line numbers, without colours. - Check what a project uses. Find
PackageReferenceto list a project’s NuGet packages, orTargetFrameworkto see which .NET version it needs. - Fix a path. If you moved a project folder and the solution can’t find it, open the
.sln, use Find and replace to correct the relative path, and Save. - Follow an error. Build errors give a file and line number. Go to line takes you there, and Document info shows the line, column, encoding and line endings. Visual Studio often saves files as UTF-8 with a byte order mark, which Document info shows as “UTF-8 BOM”.
- Work across files. Tabs let you keep
MainWindow.xamlandMainWindow.xaml.csopen together.
There are limits. Folders doesn’t build, run or debug anything, and it has no designer for XAML: you see the markup, not the window it describes.
Other ways to open .cs files
- Visual Studio Community (free, Windows): the full environment for .sln solutions, C# and C++ projects, and XAML designers.
- Visual Studio Code with Microsoft’s C# Dev Kit, on Windows and Linux.
- JetBrains Rider, a cross-platform IDE for .NET and Unity.
- The .NET SDK on its own:
dotnet buildanddotnet runwork from a terminal on Windows and Linux.
Problems opening a .cs file?
- The solution says a project can’t be found. A
.slnonly stores relative paths to.csprojfiles. If you were sent the.slnalone, the projects aren’t there. Open it in Folders to see which folders it expects. - Merge conflict markers. After a bad Git merge, project files can contain lines like
<<<<<<< HEAD, which stop Visual Studio loading them. Find<<<<<<<to locate each one and tidy it up. - A Unity script won’t attach to an object. Unity expects the class name inside a
.csfile to match the file name. Renaming one without the other is a common cause.
Questions people ask
Can I open a .cs file without Visual Studio? Yes. It’s text. Folders, VS Code or even Notepad will show it. You only need Visual Studio, Rider or the .NET SDK to build it.
What is a .sln file and can I open it on Android? It’s a Visual Studio solution, a list of projects. Folders opens it as text on Android, so you can see which projects it contains, though you can’t build them on a phone.
.csproj vs .sln: what’s the difference?
A .csproj describes one project. A .sln groups one or more projects so they open and build together.
Is a .xaml file a web page? No. It’s XML that describes a desktop or mobile app’s interface. It only turns into a window once an app is built from it.
Writing C or C++ too? Read how to open .c, .h and .cpp files, or see how to open XML files for more about the markup inside project files. Folders handles far more than code: here are all 382 file types Folders opens.
Keep reading
How to open .C files (C and C++ source code) on Android, Windows and Linux
What .c, .h and .cpp files are and how to open, read and edit C, C++ and Objective-C source code for free on Android, Windows and Linux, with no IDE needed.
How to open .CSS files (style sheets) on Android, Windows and Linux
What CSS, SCSS, Sass and Less files are and how to open, read and edit style sheets for free on Android, Windows and Linux, with colours, search and replace.
How to open .DOCKERFILE files (Docker build files) on Android, Windows and Linux
What a Dockerfile is and how to open Dockerfiles, Makefiles (.mk, .mak), CMake, Terraform (.tf, .hcl) and .nix files for free on Android, Windows and Linux.



