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.packageId stringThe package id of the tool.Returns
IResourceBuilder<DotnetToolResource> The ApplicationModel.IResourceBuilder`1 .AddDotnetTool(IDistributedApplicationBuilder, T) Section titled AddDotnetTool(IDistributedApplicationBuilder, T)extensionI 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
builderIresourceTThe .NET tool resource instance to add and configure.Returns
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 .Remarks
This method is not available in polyglot AppHosts. Use the overload with name and packageId instead.
WithToolIgnoreExistingFeeds(IResourceBuilder<T>) Section titled WithToolIgnoreExistingFeeds(IResourceBuilder<T>)extensionI 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
builderIApplicationModel.IResourceBuilder`1 .Returns
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.WithToolIgnoreFailedSources(IResourceBuilder<T>) Section titled WithToolIgnoreFailedSources(IResourceBuilder<T>)extensionI 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
builderIApplicationModel.IResourceBuilder`1 .Returns
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.WithToolPackage(IResourceBuilder<T>, string) Section titled WithToolPackage(IResourceBuilder<T>, string)extensionI 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
builderIApplicationModel.IResourceBuilder`1 .packageId stringThe 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>)extensionI Allows prerelease versions of the tool to be used
public static class DotnetToolResourceExtensions{ public static IResourceBuilder<T> WithToolPrerelease<T>( this IResourceBuilder<T> builder) { // ... }}Parameters
builderIApplicationModel.IResourceBuilder`1 .Returns
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.WithToolSource(IResourceBuilder<T>, string) Section titled WithToolSource(IResourceBuilder<T>, string)extensionI 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
builderIApplicationModel.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)extensionI 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
builderIApplicationModel.IResourceBuilder`1 .versionstringThe package version to useReturns
IResourceBuilder<T> The ApplicationModel.IResourceBuilder`1 for chaining.