I have a PHP website which I am learning PHP on, which is on Linux server. How can I run this C# code without conflicting with current PHP code? When I open URL like site.com/hello.cs
, it just shows the whole thing as text? What do I need to run this code on server?
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
C# files (.cs) need to be compiled before they run. Check out the Mono project....
Here's the basic outline of what you need to do to get a web site running:
Also, just so you know, your code example above won't render as a web page as is. That's code for a command-line-based application. MonoDevelop comes out of the box with decent templates for web sites though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With