CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 13.2.1-beta.528

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.
dotnet add package CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects --version 13.2.1-beta.528
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects -Version 13.2.1-beta.528
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects" Version="13.2.1-beta.528" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects" Version="13.2.1-beta.528" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects --version 13.2.1-beta.528
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects, 13.2.1-beta.528"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects@13.2.1-beta.528
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects&version=13.2.1-beta.528&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects&version=13.2.1-beta.528&prerelease
                    
Install as a Cake Tool

CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects library

This package provides Aspire integration for SQL Server Database Projects. It allows you to publish SQL Database Projects as part of your Aspire AppHost projects. It currently works with both MSBuild.Sdk.SqlProj and Microsoft.Build.Sql based projects.

Usage

To use this package, install it into your Aspire AppHost project:

dotnet add package CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects

Next, add a reference to the MSBuild.Sdk.SqlProj or Microsoft.Build.Sql project you want to publish in your Aspire AppHost project:

dotnet add reference ../MySqlProj/MySqlProj.csproj

Note: Adding this reference will currently result in warning ASPIRE004. This is a known issue and will be resolved in a future release.

Finally add the project as a resource to your Aspire AppHost:

var builder = DistributedApplication.CreateBuilder(args);

var sql = builder.AddSqlServer("sql")
                 .AddDatabase("test");

builder.AddSqlProject<Projects.MySqlProj>("mysqlproj")
       .WithReference(sql);

builder.Build().Run();

Now when you run your Aspire AppHost project you will see the SQL Database Project being published to the specified SQL Server.

Local .dacpac file support

If you are sourcing your .dacpac file from somewhere other than a project reference, you can also specify the path to the .dacpac file directly:

var builder = DistributedApplication.CreateBuilder(args);

var sql = builder.AddSqlServer("sql")
                 .AddDatabase("test");

builder.AddSqlProject("mysqlproj")
       .WithDacpac("path/to/mysqlproj.dacpac")
       .WithReference(sql);

builder.Build().Run();

Support for existing SQL Server

Instead of using the AddSqlServer method to use a SQL Server container, you can specify a connection string to an existing server:

var builder = DistributedApplication.CreateBuilder(args);

// Get an existing connection string from the configuration
var connection = builder.AddConnectionString("Aspire");

builder.AddSqlProject<Projects.SdkProject>("mysqlproj")
       .WithReference(connection);

builder.Build().Run();

Deployment options support

Define options that affect the behavior of package deployment.

var builder = DistributedApplication.CreateBuilder(args);

var sql = builder.AddSqlServer("sql")
                 .AddDatabase("test");

builder.AddSqlProject("mysqlproj")
       .WithConfigureDacDeployOptions(options => options.IncludeCompositeObjects = true)
       .WithReference(sql);

builder.Build().Run();

Ability to skip deployment

You can use the WithSkipWhenDeployed method to avoid re-deploying your SQL Database Project if no changes have been made. This is useful in scenarios where the SQL container database is persisted to permanent disk and will significantly improve the Aspire AppHost project startup time.

var builder = DistributedApplication.CreateBuilder(args);

var server = builder.AddSqlServer("sql")
    .WithDataVolume("testdata")
    .WithLifetime(ContainerLifetime.Persistent);

var database = server.AddDatabase("test");

var sdkProject = builder.AddSqlProject<Projects.SdkProject>("mysqlproj")
    .WithSkipWhenDeployed()
    .WithReference(database);

builder.Build().Run();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
13.2.1-beta.528 36 3/5/2026
13.1.2-beta.518 81 2/17/2026
13.1.2-beta.516 61 2/9/2026
13.1.2-beta.515 61 2/2/2026
13.1.2-beta.514 55 1/30/2026
13.1.2-beta.513 52 1/29/2026
13.1.2-beta.512 51 1/29/2026
13.1.2-beta.511 54 1/28/2026
13.1.2-beta.509 58 1/20/2026
13.1.2-beta.508 63 1/19/2026
13.1.2-beta.507 50 1/19/2026
13.1.2-beta.506 52 1/16/2026
13.1.2-beta.505 53 1/16/2026
13.1.2-beta.504 55 1/16/2026
13.1.1 6,838 1/16/2026
13.1.1-beta.502 55 1/16/2026
13.1.0 630 1/14/2026
13.1.0-beta.499 56 1/14/2026
13.0.1-beta.498 57 1/14/2026
13.0.1-beta.486 87 1/12/2026
Loading failed