Skip to content

ASP.NET

ASP.NET is Microsoft’s open-source web framework for building modern, high-performance web apps and APIs with .NET. Choose this component when you’re shipping server-rendered sites, REST backends, or full-stack applications that benefit from the .NET ecosystem and tooling. Diploi handles the build/publish pipeline and runs your ASP.NET app as a service with the runtime and networking it needs.

Paste this entry into the components list in diploi.yaml to add ASP.NET to your project.

components:
- name: ASP.NET
identifier: asp
package: https://github.com/diploi/component-asp#v10.0-05.2026
  1. In the Dashboard, click Create Project +
  2. Under Pick Components, choose ASP.NET. Here you can also add a frontend framework to create a monorepo app
  3. In Pick Add-ons, you can add one or multiple databases to your app
  4. Choose Create Repository to generate a new GitHub repo
  5. Finally, click Launch Stack

Link to the full guide - upcoming

During development, the container uses dotnet watch to enable automatic reloads when files change. The development server is started with:

Terminal window
dotnet watch --no-launch-profile --hot-reload --non-interactive

This will:

  • Use dotnet watch to monitor for changes to C# source files and restart the server when changes are detected.
  • Run the ASP.NET application with hot reload enabled.
  • Start the app on port 5103.
  • Avoid using any launch profile so environment variables are controlled by the container.

NuGet packages (C# libraries and frameworks):

Terminal window
dotnet add package <PackageName>

For example:

Terminal window
dotnet add package Newtonsoft.Json
dotnet add package Microsoft.EntityFrameworkCore.SqlServer

Important: After running dotnet add package <PackageName>, always run dotnet build to resolve new dependency update.

Builds a production-ready image. During the build, dependencies are restored with dotnet restore and the application is published with dotnet publish. When the container starts, it runs:

Terminal window
dotnet component-asp.dll

This uses the compiled .NET application optimized for production deployment.

The application uses ASP.NET Core Data Protection for securing authentication cookies and anti-forgery tokens. In Kubernetes deployments, data protection keys are persisted using a PersistentVolumeClaim to ensure session continuity across pod restarts.