Skip to content
Docs Try Aspire

DotnetToolResourceExtensions Methods

Class Methods 8 members
Provides extension methods for adding Dotnet Tool resources to the application model.
AddDotnetTool(IDistributedApplicationBuilder, string, string) Section titled AddDotnetTool(IDistributedApplicationBuilder, string, string) extension IResourceBuilder<DotnetToolResource>
Adds a .NET tool resource to the application model.
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<DotnetToolResource> AddDotnetTool(
this IDistributedApplicationBuilder builder,
string name,
string packageId)
{
// ...
}
}
name string The name of the resource.
packageId string The package id of the tool.
IResourceBuilder<DotnetToolResource> The ApplicationModel.IResourceBuilder`1.
AddDotnetTool(IDistributedApplicationBuilder, T) Section titled AddDotnetTool(IDistributedApplicationBuilder, T) extension IResourceBuilder<T>
Adds a .NET tool resource to the distributed application model and configures it for execution via the dotnet tool exec command.
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> AddDotnetTool<T>(
this IDistributedApplicationBuilder builder,
T resource)
{
// ...
}
}
builder IDistributedApplicationBuilder The distributed application builder to which the .NET tool resource will be added.
resource T The .NET tool resource instance to add and configure.
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1.
This method is not available in polyglot app hosts. Use the overload with name and packageId instead.
WithToolIgnoreExistingFeeds(IResourceBuilder<T>) Section titled WithToolIgnoreExistingFeeds(IResourceBuilder<T>) extension IResourceBuilder<T>
Configures the tool to use only the specified package sources, ignoring existing NuGet configuration.
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> WithToolIgnoreExistingFeeds<T>(
this IResourceBuilder<T> builder)
{
// ...
}
}
builder IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1.
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolIgnoreFailedSources(IResourceBuilder<T>) Section titled WithToolIgnoreFailedSources(IResourceBuilder<T>) extension IResourceBuilder<T>
Configures the resource to treat package source failures as warnings.
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> WithToolIgnoreFailedSources<T>(
this IResourceBuilder<T> builder)
{
// ...
}
}
builder IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1.
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolPackage(IResourceBuilder<T>, string) Section titled WithToolPackage(IResourceBuilder<T>, string) extension IResourceBuilder<T>
Sets the package identifier for the tool configuration associated with the resource builder.
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> WithToolPackage<T>(
this IResourceBuilder<T> builder,
string packageId)
{
// ...
}
}
builder IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1.
packageId string The package identifier to assign to the tool configuration. Cannot be null.
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolPrerelease(IResourceBuilder<T>) Section titled WithToolPrerelease(IResourceBuilder<T>) extension IResourceBuilder<T>
Allows prerelease versions of the tool to be used
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> WithToolPrerelease<T>(
this IResourceBuilder<T> builder)
{
// ...
}
}
builder IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1.
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolSource(IResourceBuilder<T>, string) Section titled WithToolSource(IResourceBuilder<T>, string) extension IResourceBuilder<T>
Adds a NuGet package source for tool acquisition.
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> WithToolSource<T>(
this IResourceBuilder<T> builder,
string source)
{
// ...
}
}
builder IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1.
source string The source to add.
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolVersion(IResourceBuilder<T>, string) Section titled WithToolVersion(IResourceBuilder<T>, string) extension IResourceBuilder<T>
Sets the package version for a tool to use.
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> WithToolVersion<T>(
this IResourceBuilder<T> builder,
string version)
{
// ...
}
}
builder IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1.
version string The package version to use
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.