Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

DotnetToolResourceExtensions Methods

ClassMethods8 members
Provides extension methods for adding Dotnet Tool resources to the application model.
AddDotnetTool(IDistributedApplicationBuilder, string, string)Section titled AddDotnetTool(IDistributedApplicationBuilder, string, string)extensionIResourceBuilder<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)
{
// ...
}
}
namestringThe name of the resource.
packageIdstringThe package id of the tool.
IResourceBuilder<DotnetToolResource>The ApplicationModel.IResourceBuilder`1.
AddDotnetTool(IDistributedApplicationBuilder, T)Section titled AddDotnetTool(IDistributedApplicationBuilder, T)extensionIResourceBuilder<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)
{
// ...
}
}
builderIDistributedApplicationBuilderThe distributed application builder to which the .NET tool resource will be added.
resourceTThe .NET tool resource instance to add and configure.
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.
This method is not available in polyglot AppHosts. Use the overload with name and packageId instead.
WithToolIgnoreExistingFeeds(IResourceBuilder<T>)Section titled WithToolIgnoreExistingFeeds(IResourceBuilder<T>)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolIgnoreFailedSources(IResourceBuilder<T>)Section titled WithToolIgnoreFailedSources(IResourceBuilder<T>)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolPackage(IResourceBuilder<T>, string)Section titled WithToolPackage(IResourceBuilder<T>, string)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.
packageIdstringThe package identifier to assign to the tool configuration. Cannot be null.
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.
Allows prerelease versions of the tool to be used
public static class DotnetToolResourceExtensions
{
public static IResourceBuilder<T> WithToolPrerelease<T>(
this IResourceBuilder<T> builder)
{
// ...
}
}
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolSource(IResourceBuilder<T>, string)Section titled WithToolSource(IResourceBuilder<T>, string)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.
sourcestringThe source to add.
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.
WithToolVersion(IResourceBuilder<T>, string)Section titled WithToolVersion(IResourceBuilder<T>, string)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.
versionstringThe package version to use
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.