Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

IsEnvironment

Method
📦 Aspire.Hosting v17.0.0
func (HostEnvironment) IsEnvironment(environmentName string) (bool, error)

Signature

methodIsEnvironment
Checks if the environment matches the specified name.
IsEnvironment(environmentName string) (bool, error)
environmentNamestringThe environment name to compare against.
(bool, error)

True if the environment matches the specified name.

Returns (bool, error).

Applies to

This method applies to the following types: