.NET by Example

hello-world

HelloWorld.vb

Our first program will print the classic "hello world" message. Here's the full source code.

Console.WriteLine("Hello, World!");

HelloWorld.fsx

Our first program will print the classic "hello world" message. Here's the full source code.

printfn "Hello from F#"

HelloWorld.csx

Our first program will print the classic "hello world" message. Here's the full source code.

Console.WriteLine("Hello, World!");

To run the program, put the code in HelloWorld.csx and use dotnet script.

dotnet script HelloWorld.csx

To run the program, put the code in HelloWorld.vb and use dotnet script.

dotnet script HelloWorld.vb

To run the program, put the code in HelloWorld.fsx and use dotnet fsi.

dotnet fsi HelloWorld.fsx

Now that we can run .NET programs, let's learn more about the language.