[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"howto:cs:mac:en":3},{"resolvedFromAlias":4,"canonicalExt":5,"ext":5,"name":6,"category":7,"categoryName":8,"updatedAt":9,"os":10,"osLabel":11,"quickSolution":12,"stepByStep":13,"recommendedSoftware":16,"alternativeMethods":17,"commonIssues":18,"securityNote":37,"extensionPath":38,"extensionLabel":39,"breadcrumbs":40,"metaDescription":50},false,"cs","C# source code file","code","Code","2026-06-12T09:03:13.752Z","mac","Mac","To open .CS files on Mac, control-click the .cs file and choose “Open With”.",[14,15],"Control-click the .cs file and choose “Open With”.","Open it in Visual Studio Code (or another text/code editor) so you can view and edit it safely as plain text.",[],[],[19,25,31],{"title":20,"description":21,"steps":22},"Double-clicking opens the wrong app (or shows as an unknown type)","If file associations are misconfigured, your system may open .cs in an unsuitable program or not know what it is. On Linux, correct identification typically comes from the shared-mime-info mapping (*.cs → text/x-csharp).",[23,24],"Use “Open with…” and pick a code editor (such as Visual Studio Code).","If you’re on Linux and file type detection seems wrong, check that your system’s shared-mime-info database is up to date and that the file still has the .cs extension.",{"title":26,"description":27,"steps":28},"VS Code prompts to install C# tooling when opening the file","Visual Studio Code can detect C# files and may prompt you to install C# support to provide features like IntelliSense and debugging.",[29,30],"Follow the prompt in VS Code to install the recommended C# tooling for C# development.","Reopen the folder/project containing the .cs file so VS Code can load the C# features correctly.",{"title":32,"description":33,"steps":34},"Code examples don’t run by just opening the .cs file","A .cs file is source code; it typically needs to be compiled/run within a proper C# workflow rather than “opened” like a document.",[35,36],"Use a C# tutorial workflow that creates and runs file-based programs (for example, create a file like AsciiArt.cs and run it as instructed).","Ensure the file is part of the intended program context (for example, the correct folder/project) before trying to execute it.",".cs files are plain text, but they can contain code that performs harmful actions if you compile and run it; treat untrusted .cs files like any other untrusted source code.","/file-extension/cs",".CS",[41,44,47],{"label":42,"to":43},"Home","/",{"label":45,"to":46},"How To","/file-extension",{"label":48,"to":49},"Open .CS on Mac","/how-to/open-cs-on-mac","Learn how to open .CS files on Mac with step-by-step instructions, recommended software, and troubleshooting tips."]