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) { // ... }}Parameters
namestringThe name of the resource.packageIdstringThe package id of the tool.Returns
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) { // ... }}Parameters
builderIDistributedApplicationBuilderThe distributed application builder to which the .NET tool resource will be added.resourceTThe .NET tool resource instance to add and configure.Returns
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.Remarks
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>)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) { // ... }}Parameters
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.Returns
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) { // ... }}Parameters
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.Returns
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) { // ... }}Parameters
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.packageIdstringThe package identifier to assign to the tool configuration. Cannot be null.Returns
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.WithToolPrerelease(IResourceBuilder<T>)Section titled WithToolPrerelease(IResourceBuilder<T>)extensionIResourceBuilder<T> Allows prerelease versions of the tool to be used
public static class DotnetToolResourceExtensions{ public static IResourceBuilder<T> WithToolPrerelease<T>( this IResourceBuilder<T> builder) { // ... }}Parameters
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.Returns
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) { // ... }}Parameters
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.sourcestringThe source to add.Returns
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) { // ... }}Parameters
builderIResourceBuilder<T>The ApplicationModel.IResourceBuilder`1.versionstringThe package version to useReturns
IResourceBuilder<T>The ApplicationModel.IResourceBuilder`1 for chaining.