How to find the environment of the windows service
-
venerdì 4 maggio 2012 23:47
Hello
I am trying to find a way to find which environment(dev, test, cert or prod) the windows service is running to set the connection string accordingly without supplying the server names.
I think i might be able to use Environment variables but i don't know for sure.
Does anyone have any information, any help is appreciated.
Thanks.
Tutte le risposte
-
sabato 5 maggio 2012 04:18
to find which environment(dev, test, cert or prod)
Hello Natty,
On which indicator do you want to get this information; there are no default settings in any way how you can get this information?
Here you have to find your own solution, may on the machine name or an own knowledge base or something else.
Olaf Helper
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
Blog Xing -
lunedì 7 maggio 2012 19:25
Thanks Olaf Helper for your response. But i am wondering that when i use the below in my dev environment
string MachineName = Environment.CurrentDirectory;
the MachineName contains \\DevServer, how can i check if it runs in test or prod environment the MachineName will contain \\TestServer or \\ProdServer.
Thanks.
-
mercoledì 9 maggio 2012 18:10Moderatore
Hello,
Please, could verify whether \\DevServer and \\TestServer are not the same ( maybe an alias ) ?
Have a nice day
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

