1
votes

I am working on an operating system with Cosmos, I am wondering if there is a way to compile text from a file, for example: helloworld.cs, and then execute the file. Thanks in advance.

1
I think this is already answered here. - bdongus
@bdongus I'm not sure Pikalover is asking within the context of how to turn helloworld.cs into helloworld.exe on a Windows system... - Caius Jard

1 Answers

0
votes

If you want to compile a c# file (.cs) like helloworld.cs in Windows

namespace test {
    class test {
        static void Main(string[] args) {
            System.Console.WriteLine("Hello World");
        }
    }

}

you can use csc.exe to compile the file

C:\Windows\Microsoft.NET\Framework\{version}\csc.exe pathToFile