ResourceBuilderExtensions.WithDeveloperCertificateTrust<TResource> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates whether developer certificates should be treated as trusted certificate authorities for the resource at run time. Currently this indicates trust for the ASP.NET Core developer certificate. The developer certificate will only be trusted when running in local development scenarios; in publish mode resources will use their default certificate trust.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<TResource> WithDeveloperCertificateTrust<TResource>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<TResource> builder, bool trust) where TResource : Aspire.Hosting.ApplicationModel.IResourceWithEnvironment, Aspire.Hosting.ApplicationModel.IResourceWithArgs;
static member WithDeveloperCertificateTrust : Aspire.Hosting.ApplicationModel.IResourceBuilder<'Resource (requires 'Resource :> Aspire.Hosting.ApplicationModel.IResourceWithEnvironment and 'Resource :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> * bool -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'Resource (requires 'Resource :> Aspire.Hosting.ApplicationModel.IResourceWithEnvironment and 'Resource :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> (requires 'Resource :> Aspire.Hosting.ApplicationModel.IResourceWithEnvironment and 'Resource :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)
<Extension()>
Public Function WithDeveloperCertificateTrust(Of TResource As {IResourceWithEnvironment, IResourceWithArgs}) (builder As IResourceBuilder(Of TResource), trust As Boolean) As IResourceBuilder(Of TResource)
Type Parameters
- TResource
The type of the resource.
Parameters
- builder
- IResourceBuilder<TResource>
The resource builder.
- trust
- Boolean
Indicates whether the developer certificate should be treated as trusted.
Returns
The IResourceBuilder<T>.
Remarks
var container = builder.AddContainer("my-service", "my-service:latest")
.WithDeveloperCertificateTrust(false);
var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions()
{
Args = args,
TrustDeveloperCertificate = false,
});
var project = builder.AddProject<MyService>("my-service")
.WithDeveloperCertificateTrust(true);