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"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides information about the \u003ccode\u003eEmulatorDetection\u003c/code\u003e enum within the \u003ccode\u003eGoogle.Api.Gax\u003c/code\u003e namespace, which dictates how an application interacts with emulators.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this documented class is 4.10.0, with previous versions being 4.8.0, 4.4.0, 4.3.1, 4.2.0, 4.0.0, and 3.2.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEmulatorDetection\u003c/code\u003e enum has four possible fields: \u003ccode\u003eEmulatorOnly\u003c/code\u003e, \u003ccode\u003eEmulatorOrProduction\u003c/code\u003e, \u003ccode\u003eNone\u003c/code\u003e, and \u003ccode\u003eProductionOnly\u003c/code\u003e, which specify whether or not to connect to an emulator and how to handle emulator configuration presence or absence.\u003c/p\u003e\n"],["\u003cp\u003eEmulator configuration is typically set through environment variables and the enum is used to control if, and how, these variables are utilized, such as \u003ccode\u003eEmulatorOrProduction\u003c/code\u003e which connects to an emulator when the configuration is present, or production otherwise.\u003c/p\u003e\n"]]],[],null,[]]