- Documentation
- Technologies
- .NET
.NET
Guara Cloud fully supports .NET applications, including ASP.NET Core web APIs, MVC apps, Blazor, and .NET console applications.
Supported versions
The following .NET versions are auto-detected:
- .NET 8.0 (LTS)
- .NET 9.0 (Current)
The version is auto-detected from the TargetFramework element in your .csproj file or from global.json.
<!-- MyApp.csproj -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
Deploy with Dockerfile
A multi-stage build is the recommended approach for .NET applications. It builds your project with the full SDK, then runs it using the lightweight ASP.NET runtime.
Deploy with Buildpack
If your repository does not contain a Dockerfile, Guara Cloud automatically detects your .NET project by the presence of a .csproj file.
The auto-detection will:
- Detect the .NET version from
TargetFrameworkin.csprojor fromglobal.json - Run
dotnet restoreanddotnet publishautomatically - Auto-detect ASP.NET Core applications
- Start the application
Port configuration
Your application must listen on the port configured in your service settings. The default is 3000, but you can change it at any time to match your application.
The recommended way to configure this in ASP.NET Core is through the ASPNETCORE_URLS environment variable:
ASPNETCORE_URLS=http://+:${PORT:-3000}
Or programmatically in Program.cs:
var port = Environment.GetEnvironmentVariable("PORT") ?? "3000";
app.Run($"http://+:{port}");
Example project structure
my-dotnet-app/
MyApp.csproj
MyApp.sln
Program.cs
Controllers/
Models/
appsettings.json
appsettings.Production.json
Dockerfile # optional — omit to use Buildpack
Environment variables
These environment variables are commonly used with .NET deployments:
| Variable | Recommended value | Description |
|---|---|---|
ASPNETCORE_URLS | http://+:${PORT:-3000} | URL and port the app listens on |
ASPNETCORE_ENVIRONMENT | Production | Sets the hosting environment |
DOTNET_RUNNING_IN_CONTAINER | true | Optimizes .NET for container environments |
PORT | Set by platform | The port your application must listen on |