n nesly

Deploy ASP.NET / .NET

How nesly detects, builds and serves a ASP.NET / .NET project — and the two commands that put it on a live URL.

Deploy ASP.NET / .NET on nesly

A ASP.NET / .NET project is built into a container and run as a server process.

nesly new dotnet-mssql my-app
cd my-app
nesly addon add mssql
nesly deploy --yes

The first deploy creates the project and prints the live URL; after that, nesly deploy is enough. The dotnet-mssql template is a complete, readable starting point.

How detection sees it

  • A .NET project (a .csproj) runs as a container; the SDK version comes from global.json when one is present.
  • With the mssql addon, ConnectionStrings__Default is injected — Configuration.GetConnectionString("Default") reads it with no configuration code.

When detection is not what you want, say it yourself: build and start commands, root directory and output directory live in nesly.toml committed next to the code — see builds.

Worth knowing

  • ASP.NET must bind the platform's port: builder.WebHost.UseUrls($"http://0.0.0.0:{port}") with port read from the PORT env var.
  • If the build fails with NETSDK1045, commit a global.json pinning an SDK that can build your TargetFramework.
  • Attach a managed database with nesly addon add postgres (or mssql) — connection env vars are injected on the next deploy.
  • When a deploy fails, nesly diagnose reads the logs for you and names the fix.

Full walkthrough: get started. Custom domains, backups, GitHub deploys and the rest of the reference: nesly CLI.