Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Build mode change at runtime
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00875066
Message ID:
00875445
Vues:
19
Stephen,

Will checking for the compiler generated DebuggableAttribute attribute do?
using System;
using System.Reflection;
using System.Diagnostics;

namespace ConsoleApplication1
{
   /// <summary>
   /// Summary description for Class1.
   /// </summary>
   class Class1
   {
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread]
      static void Main(string[] args)
      {
         DebuggableAttribute dbg = (DebuggableAttribute)Attribute.GetCustomAttribute(
            System.Reflection.Assembly.GetExecutingAssembly(), 
            typeof(DebuggableAttribute));

         if (dbg != null)
            Console.WriteLine("Debug Mode");
         else
            Console.WriteLine("Release Mode");
      }
   }
}
Regards
Neil
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform