Dotnet
Railpack builds and deploys Dotnet applications with zero configuration.
Detection
Section titled “Detection”Your project will be detected as a Dotnet application if a *.csproj file
Versions
Section titled “Versions”The Dotnet version is determined in the following order:
- Read
TargetFrameworkfrom the first*.csprojfile found in the project - Read
versionfrom theglobal.jsonfile in the project root - Set via the
RAILPACK_DOTNET_VERSIONenvironment variable - Defaults to
6.0.428
Configuration
Section titled “Configuration”Railpack builds your Dotnet application based on your project structure. The build process:
- Installs Dotnet SDK and Runtime
- Caches dependencies using
dotnet restore - Builds the project using
dotnet publish --no-restore -c Release -o out - Sets up the start command based on the publish output
./out/{project_name}
Config Variables
Section titled “Config Variables”| Variable | Description | Example |
|---|---|---|
RAILPACK_DOTNET_VERSION | Override the Dotnet version | 6.0.428 |
Runtime Packages
Section titled “Runtime Packages”The libicu-dev package is installed to support internationalization in your Dotnet applications.
Port Binding
Section titled “Port Binding”Railpack automatically configures your application to listen on the port specified by the PORT environment variable (defaulting to 3000).
This is achieved by setting the ASPNETCORE_URLS environment variable in the start command:
ASPNETCORE_URLS=http://0.0.0.0:${PORT:-3000}.
This ensures the application listens on all network interfaces (0.0.0.0) rather than just localhost, making it accessible externally.