CommunityToolkit.Aspire.Hosting.Solr 17.0.0

Prefix Reserved
dotnet add package CommunityToolkit.Aspire.Hosting.Solr --version 17.0.0
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Solr -Version 17.0.0
                    
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.Solr" Version="17.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Solr" Version="17.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Solr" />
                    
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.Solr --version 17.0.0
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.Solr, 17.0.0"
                    
#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.Solr@17.0.0
                    
#: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.Solr&version=17.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Solr&version=17.0.0
                    
Install as a Cake Tool

CommunityToolkit.Aspire.Hosting.Solr

This package provides an Aspire hosting integration for Apache Solr, enabling you to add and configure a Solr container as part of your distributed application.

Getting Started

Install the package

In your AppHost project, install the package using the following command:

dotnet add package CommunityToolkit.Aspire.Hosting.Solr

Usage Example

var builder = DistributedApplication.CreateBuilder(args);

// Add Solr resource with default settings (port 8983, core "solr")
var solr = builder.AddSolr("solr");

// Add Solr with custom port
var solrWithCustomPort = builder.AddSolr("solr-custom", port: 8984);

// Add Solr with custom core name
var solrWithCustomCore = builder.AddSolr("solr-core", coreName: "mycore");

// Add Solr with both custom port and core name
var solrCustom = builder.AddSolr("solr-full", port: 8985, coreName: "documents");

// Reference the Solr resource in a project
var exampleProject = builder.AddProject<Projects.ExampleProject>()
                            .WithReference(solr);

// Initialize and run the application
builder.Build().Run();

Using a Custom Config Set

You can configure Solr to use a custom config set by calling WithConfigset on the Solr resource builder. This mounts a local config set directory into the container and creates the core using that config set.

var builder = DistributedApplication.CreateBuilder(args);

// Add Solr with a custom config set
var solr = builder.AddSolr("solr", coreName: "mycore")
                  .WithConfigset("my-config", "/path/to/configsets/my-config");

builder.Build().Run();

The WithConfigset method takes two parameters:

  • configSetName — the name of the config set as it will appear inside the container (under /opt/solr/server/solr/configsets/)
  • configSetPath — the absolute path on the host to the config set directory to mount

When a config set is provided, the core is created with solr-create -c <coreName> -d <configSetName> instead of the default solr-precreate <coreName>.

Persisting Data

Using a Named Volume

Use WithDataVolume to persist Solr data across container restarts with a Docker named volume:

var builder = DistributedApplication.CreateBuilder(args);

// Use an auto-generated volume name
var solr = builder.AddSolr("solr")
                  .WithDataVolume();

// Or specify a custom volume name
var solrNamed = builder.AddSolr("solr")
                       .WithDataVolume("my-solr-data");

builder.Build().Run();

Using a Bind Mount

Use WithDataBindMount to mount a host directory into the container for data storage:

var builder = DistributedApplication.CreateBuilder(args);

var solr = builder.AddSolr("solr")
                  .WithDataBindMount("/path/to/solr/data");

builder.Build().Run();

The WithDataBindMount method mounts the specified host path to /var/solr inside the container. The directory must be writable by the Solr process (UID 8983).

Feedback & contributing

https://github.com/dotnet/aspire

Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
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
17.0.0 57 11/20/2026
17.0.0-beta.1090 59 11/20/2026
17.0.0-beta.1088 47 11/20/2026
17.0.0-beta.1080 84 11/20/2026
17.0.0-beta.1078 55 11/19/2026
17.0.0-beta.1077 48 11/19/2026
17.0.0-beta.1076 48 11/19/2026
17.0.0-beta.1075 46 11/19/2026
17.0.0-beta.1052 60 11/16/2026
17.0.0-beta.1051 67 11/12/2026
17.0.0-beta.1033 61 11/10/2026
17.0.0-beta.1022 69 11/8/2026
17.0.0-beta.1018 72 11/6/2026
17.0.0-beta.1009 63 11/5/2026
17.0.0-beta.994 66 11/4/2026
17.0.0-beta.993 66 11/4/2026
13.6.2-beta.959 78 10/27/2026
13.6.1 253 10/26/2026
13.6.1-beta.950 75 10/26/2026
13.6.1-beta.938 65 10/24/2026
Loading failed