0

In Azure function app based on settings value, I want to switch namespace. For example

#if System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process) == "true" 
namespace TestA
#else
namespace TestB
#endif

Please help me on this. If you have other approaches other than this example please suggest me

  • It seems like you do not really know basics of [preprocessors](https://stackoverflow.com/questions/12982106/what-does-preprocessing-exactly-mean-in-compiler). – mrogal.ski Feb 15 '18 at 07:37
  • @m.rogalski: Do you have any idea of achieving the namespace switching based on the key value? – thamatam kiran Feb 15 '18 at 08:26
  • If you want to switch it at runtime then, no. There's no way other than recompiling that code over and over again when the value is changing. And even then you would have to make some background check every few seconds to get the actual value and recompile that piece of code. – mrogal.ski Feb 15 '18 at 08:28
  • @m.rogalski: Thanks for the information – thamatam kiran Feb 15 '18 at 10:15

0 Answers0