I got a c# project in Visual Studio of a cloud system with services inside a docker. I am searching for a way to detect in the code:
If the code running in a real deployment in a production environment or if it's running locally because the user clicked on the play button in VS (Is it also possible to refine the VS part and distinguish between running in debug mode or starting the program without debugging)?
Read data according to the mode the code is running from step 1.
Pseudo code of what I mean:
string someData = null;
if(IsRunningFromPlayButtonInVS()) someData = GetVSData();
else if(IsRunningInRealDeployment()) someData = GetDeploymentData();
Is such a thing possible? Even if you know only the first section of detecting the mode I'm running that can also be useful.