Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Build mode change at runtime
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00875066
Message ID:
00875445
Views:
17
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
Previous
Reply
Map
View

Click here to load this message in the networking platform