0

We can build and run a single file C# code with mono compiler up to C# 6. But for latest C# version - C# 12 - Mono doesn't have support for it. So, is there a way we can run a single file C# code with .NET 8?

I know we can build a simple console project, but I want to know if we can do it without creating a project or .csproj file.

3
  • 2
    Are you talking "single file" in terms of a self-contained executable as the result, or a single source file? If you could give more details about what you're trying to do, that would help. Commented May 14, 2024 at 16:58
  • The following may be of interest: Single-file deployment Commented May 14, 2024 at 17:38
  • If you've tagged this "dotnet-cli", what does the mono compiler have to do with this? Are you talking about CS-Script? What about any of the options on this page stackoverflow.com/questions/46065777/… ? But I'm not sure what advantage you're expecting to see by not making a project file and compiling the file yourself. Commented May 14, 2024 at 19:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.