# Deploy ASP.NET Core on Light Cloud

> ASP.NET Core is the .NET framework for web apps and APIs in C#. Light Cloud detects it from a .csproj at the root or up to two folders under src/. It runs as a container that scales with traffic and down to zero when idle.

## ASP.NET Core at a glance

- **Detected from:** a `.csproj` at the root or up to two folders under `src/`
- **Runs as:** Container that scales with traffic and to zero when idle
- **.NET:** .NET 8.0, 9.0 or 10.0 (default 10.0), read from `TargetFramework`
- **Start command:** `dotnet <Project>.dll`
- **Port:** 8080, set through `ASPNETCORE_URLS`

## How to deploy ASP.NET Core

1. **Bring the code.** Pick a repository, upload a folder, or ask Claude Code or GitHub Copilot to put it online.
2. **ASP.NET Core, detected.** The files are read and the build is filled in. Every setting can be changed by hand.
3. **Built into a container.** An image is built and started, listening on the port the app expects.
4. **Live.** A light-cloud.io URL in minutes, a preview URL for every branch, and logs and metrics beside it.

## More on .NET

- [.NET](https://light-cloud.com/runtimes/dotnet): .NET 8, 9 or 10
- [Blazor](https://light-cloud.com/frameworks/blazor): Web UI in C#

## Add a database

- [PostgreSQL](https://light-cloud.com/databases/postgresql): Shared or dedicated

## Questions

### How do I deploy ASP.NET Core?

Connect the repository, upload the folder, or ask Claude Code or GitHub Copilot to deploy it. Light Cloud reads the files, builds ASP.NET Core and returns a live URL in minutes, with a preview URL for every branch.

### How much does it cost to host ASP.NET Core?

The Free plan runs up to 3 server apps with $1 of usage a month and no card. A container is billed by the hour only while it runs, so an idle app costs nothing and a quiet one uses about $0.10 a month. Paid plans start at $5 a month with $5 of usage included.

### Can a ASP.NET Core app use a database?

Yes. Create a PostgreSQL database in the same project and set its connection string as DATABASE_URL. Databases come with paid plans, from $5 a month.

### Can I use my own Dockerfile instead?

Yes. A Dockerfile at the root of the repository always wins over detection: it is built as is and runs as a container.

Docs: https://docs.light-cloud.com/platform/frameworks/aspnet
Page: https://light-cloud.com/frameworks/aspnet
Deploy ASP.NET Core: https://console.light-cloud.com/new?repo=https://github.com/light-cloud-templates/aspnet-core-api-starter
Start free, no card: https://console.light-cloud.com/signup
