CommunityToolkit.Aspire.Hosting.Solr 13.4.0

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CommunityToolkit.Aspire.Hosting.Solr --version 13.4.0
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Solr -Version 13.4.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="13.4.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="13.4.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 13.4.0
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.Solr, 13.4.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@13.4.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=13.4.0
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Solr&version=13.4.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 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.4.1-beta.685 36 7/9/2026
13.4.1-beta.683 38 7/9/2026
13.4.1-beta.680 39 7/7/2026
13.4.1-beta.676 41 7/7/2026
13.4.1-beta.675 43 7/6/2026
13.4.1-beta.674 46 7/6/2026
13.4.0 454 6/2/2026
13.4.0-beta.671 47 7/3/2026
13.4.0-beta.654 65 6/18/2026
13.4.0-beta.651 59 6/17/2026
13.3.0 369 5/14/2026
13.2.1-beta.604 59 5/14/2026
13.2.1-beta.532 83 3/13/2026
13.2.1-beta.531 85 3/11/2026
13.2.1-beta.528 72 3/5/2026
13.1.2-beta.518 75 2/17/2026
13.1.2-beta.516 88 2/9/2026
13.1.2-beta.515 74 2/2/2026
13.1.2-beta.514 81 1/30/2026
13.1.2-beta.513 76 1/29/2026
Loading failed