Skip to content
Docs Try Aspire

ProjectResourceBuilderExtensions

Class static net10.0
📦 Aspire.Hosting v13.1.2
Provides extension methods for IDistributedApplicationBuilder to add and configure project resources.
namespace Aspire.Hosting;
public static class ProjectResourceBuilderExtensions
{
// ...
}
AddCSharpApp(IDistributedApplicationBuilder, string, string)extensionexperimental
IResourceBuilder<ProjectResource>
Adds a C# project or file-based app to the application model.
AddCSharpApp(IDistributedApplicationBuilder, string, string, Action<ProjectResourceOptions>)extensionexperimental
IResourceBuilder<CSharpAppResource>
Adds a C# project or file-based app to the application model.
AddProject(IDistributedApplicationBuilder, string)extension
IResourceBuilder<ProjectResource>
Adds a .NET project to the application model.
AddProject(IDistributedApplicationBuilder, string, string)extension
IResourceBuilder<ProjectResource>
Adds a .NET project to the application model.
AddProject(IDistributedApplicationBuilder, string, string?)extension
IResourceBuilder<ProjectResource>
Adds a .NET project to the application model. By default, this will exist in a Projects namespace. e.g. Projects.MyProject. If the project is not in a Projects namespace, make sure a project reference is added from the AppHost project to the target project.
AddProject(IDistributedApplicationBuilder, string, string, string?)extension
IResourceBuilder<ProjectResource>
Adds a .NET project to the application model.
AddProject(IDistributedApplicationBuilder, string, Action<ProjectResourceOptions>)extension
IResourceBuilder<ProjectResource>
Adds a .NET project to the application model.
AddProject(IDistributedApplicationBuilder, string, string, Action<ProjectResourceOptions>)extension
IResourceBuilder<ProjectResource>
Adds a .NET project to the application model.
DisableForwardedHeaders(IResourceBuilder<ProjectResource>)extension
IResourceBuilder<ProjectResource>
Configures the project to disable forwarded headers when being published.
PublishAsDockerFile(IResourceBuilder<T>, Action<IResourceBuilder<ContainerResource>>)extension
Adds support for containerizing this ProjectResource during deployment. The resulting container image is built, and when the optional configure action is provided, it is used to configure the container resource.
WithEndpointsInEnvironment(IResourceBuilder<ProjectResource>, Func<EndpointAnnotation, bool>)extension
IResourceBuilder<ProjectResource>
Set a filter that determines if environment variables are injected for a given endpoint. By default, all endpoints are included (if this method is not called).
WithReplicas(IResourceBuilder<ProjectResource>, int)extension
IResourceBuilder<ProjectResource>
Configures how many replicas of the project should be created for the project.
View all methods