Runway
Runway is built and operated in the EU!

Deploy .NET

First steps

Let’s deploy a small HTTP service written in .NET on Runway!

Setup

Create a new (web) project for your .NET app:

$ dotnet new web -o my-app

Then go into the my-app directory:

$ cd my-app

Create the app on Runway (this also initializes a git repository, if none exists yet):

$ runway app create

The app

The Program.cs file will contain your route. Let’s also log all requests (using a middleware) and configure the web server through a PORT environment variable (with a default of 5000):

Program.cs
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

var logger = app.Logger;

string port = Environment.GetEnvironmentVariable("PORT") ?? "5000";

// middleware
app.Use(async (context, next) =>
{
    logger.LogInformation("Request: {Method} {Path}",
        context.Request.Method,
        context.Request.Path);

    await next();
});

app.MapGet("/", () => "Hello World!");

app.Run($"http://0.0.0.0:{port}");

Pay special attention to the app.Run(), by default the project will only be available on localhost.

Now that all is configured and setup, let’s git commit and deploy!

Deploy to Runway

runway app deploy

Run runway app open to see it live, or check the Runway UI. Check runway app logs if something’s off.

Congrats, your dotnet app is now on Runway! ✅