mardi 3 janvier 2017

How to detect development environment in c#?

For testing purposes I would like to know which IDE was used to compile my C# program (I use several computers, all with both Visual Studio and Sharpdevelop installed).

So, is it possible to detect the development environment from which the compiler is being called? Say, a preprocessor directive or variable, or maybe from reflection... Something like:

#if SHARPDEVELOP
   string compiledFromIDE = "Sharpdevelop";
#elif VISUALSTUDIO
   string compiledFromIDE = "VisualStudio";
#else
   string compiledFromIDE = "Unknown";
#endif

Note that I'm NOT trying to find whether I'm running from IDE or not, nor I'm looking for Debug/Release version, nor the compiler version. I've thoroughly searched google/SO without success.





Aucun commentaire:

Enregistrer un commentaire