CI/CD Pipeline

.NET CI/CD Pipelines — Ship C# Applications with Confidence

Modern .NET runs on Linux containers, but the build and deployment tooling still has rough edges. NuGet restore times, solution-level builds with multiple projects, Entity Framework migrations, and the choice between self-contained and framework-dependent deployments all need careful handling. We build pipelines that get .NET apps from commit to production reliably.

Need this done for your project?

We implement, you ship. Async, documented, done in days.

Start a Brief

Why .NET Needs a Proper CI/CD Pipeline

.NET solutions often contain multiple projects — web APIs, background workers, class libraries, and test projects — all in a single .sln file. Building and testing this efficiently in CI requires understanding the dependency graph between projects and restoring NuGet packages from a cached feed.

Entity Framework Core migrations are a common pain point. Running dotnet ef database update in production requires the EF tooling, a connection string, and careful ordering relative to the application deployment. Many teams skip automated migrations and run them manually, which inevitably leads to forgotten migrations and production errors.

The .NET SDK produces different output depending on the publish profile: framework-dependent (smaller, needs .NET runtime on host), self-contained (larger, bundles the runtime), or trimmed (smallest, but can break reflection-heavy code). Your pipeline needs to use the right profile for your deployment target and validate that trimming did not break anything.

Our .NET CI/CD Implementation

We configure NuGet package caching based on *.csproj and NuGet.config hashes. The dotnet restore step runs once and subsequent build steps use --no-restore to avoid redundant package resolution. For solutions with many projects, we use dotnet build at the solution level to leverage MSBuild's incremental build capabilities.

Testing runs dotnet test with xUnit or NUnit, configured for parallel test collection execution. We use --collect:"XPlat Code Coverage" with Coverlet for coverage reporting. For integration tests, we configure Testcontainers for .NET to spin up SQL Server, PostgreSQL, or other dependencies. Test results are output in TRX format and converted to JUnit XML for CI dashboard integration.

Docker builds use the official mcr.microsoft.com/dotnet/sdk image for building and mcr.microsoft.com/dotnet/aspnet for the runtime stage. We configure the publish step with -c Release --self-contained false for framework-dependent deployment (smaller images) or --self-contained true -p:PublishTrimmed=true for minimal deployments. EF migrations run as a separate init container or pre-deploy job.

What You Get

A .NET-optimized CI/CD pipeline:

  • Fast NuGet restore — package cache with smart invalidation on dependency changes
  • Solution-level builds — efficient MSBuild with incremental compilation
  • Test automation — xUnit/NUnit with parallel execution and coverage reporting
  • Entity Framework migrations — automated, run as pre-deploy step with rollback support
  • Optimized Docker images — multi-stage build with appropriate publish profile
  • Health check validation — ASP.NET Core health endpoints checked post-deploy
  • Configuration management — secrets and appsettings handled per environment

Why Anubiz Engineering

100% async — no calls, no meetings
Delivered in days, not weeks
Full documentation included
Production-grade from day one
Security-first approach
Post-delivery support included

Ready to get started?

Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.