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.Reflecti on.Assembly.Loa dXXX(...)
Dim objAssembly As System.Reflecti on.Assembly
objAssembly = System.Reflecti on.Assembly.Get ExecutingAssemb ly()
If objAssembly.Get CustomAttribute s(GetType(Debug gableAttribute) ,
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******** ******@TK2MSFTN GP09.phx.gbl...
Thanks, any chance you could tell me were can I see this
"System.Diagnos tics.Debuggable Attribute" 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.goo glegroups.com.. . Some brief experimentation suggests that the compiler automatically
adds a System.Diagnost ics.DebuggableA ttribute 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