Specifies whether or not an emulator configuration should be present and
whether or not it should be used. Emulator configuration is usually specified
through environment variables.
Always connect to the emulator, throwing an exception if no emulator
configuration is detected.
EmulatorOrProduction
Connect to the emulator if an emulator configuration is detected,
or production otherwise. This is a convenient option, but risks damage to
production databases or running up unexpected bills if tests are accidentally
run in production due to the emulator configuration being absent unexpectedly.
(Using separate projects for production and testing is a best practice for
preventing the first issue, but may be unrealistic for small or hobby projects.)
None
Ignores the presence or absence of emulator configuration.
ProductionOnly
Always connect to the production servers, but throw an exception if
an emulator configuration is detected that would suggest connecting to
an emulator is expected.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-17 UTC."],[[["The `EmulatorDetection` enum controls whether an application connects to an emulator or production environment, based on the presence of emulator configuration variables."],["The enum offers four settings: `EmulatorOnly` (always use the emulator), `EmulatorOrProduction` (use emulator if configured, otherwise production), `None` (ignore emulator configuration), and `ProductionOnly` (always use production, fail if emulator configured)."],["The `EmulatorOrProduction` setting carries risk, potentially leading to production issues if an emulator configuration is missing unexpectedly."],["This class can be found within the `Google.Api.Gax` namespace and is contained within the `Google.Api.Gax.dll` assembly."],["There are several documented versions of this documentation, ranging from the latest 4.10.0 down to 3.2.0, however the specific version for the current page is 4.0.0."]]],[]]