Hi Rene,
You can use the code below from within a running assembly (VB.NET, translate
it to C#). For an external assembly, use objAssembly =
System.Reflection.Assembly.LoadXXX(...)
Dim objAssembly As System.Reflection.Assembly
objAssembly = System.Reflection.Assembly.GetExecutingAssembly()
If objAssembly.GetCustomAttributes(GetType(Debuggable Attribute),
True).GetLength(0) > 0 Then
MessageBox.Show("Debug")
Else
MessageBox.Show("Release")
End If
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Rene" <no****@nospam.com> escribió en el mensaje
news:uJ**************@TK2MSFTNGP09.phx.gbl...
Thanks, any chance you could tell me were can I see this
"System.Diagnostics.DebuggableAttribute" attribute?
Is this something you can see using Ildasm? I open a Debugged file using
Ildasm and I just can't find this Attribute, I must be missing something
really obvious.
Thanks.
<jm*****@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... Some brief experimentation suggests that the compiler automatically
adds a System.Diagnostics.DebuggableAttribute to the assembly when it's
compiled in debug mode (csc /debug+).
Also, debug mode usually means optimizations are off, and you can spot
an unoptimized method because it'll be full of "nop" instructions.
Jesse