is ther a way to do that with code? I wanna know if my app is running in debug mode or release mode
Printable View
is ther a way to do that with code? I wanna know if my app is running in debug mode or release mode
Hi Mr. Polite.
After a (big) bit of tinkering, I finally came up with this.
VB Code:
Dim a As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly Dim o() As Object = a.GetCustomAttributes(GetType(System.Diagnostics.DebuggableAttribute), True) If o.Length > 0 Then MsgBox("Debug Mode") Else MsgBox("Release Mode") End If
Strange thing is, that when searching in the help, they claim that there is a DefineDebug property, but that's nowhere to be found.
The FileVersionInfo has a IsDebug property, which apparently always returns false, so that's not much use either.
But as far as I can tell, the above solution appears solid.
Enjoy. :wave:
haha thank you:D sorry for the troubleQuote:
Originally posted by pax
Hi Mr. Polite.
After a (big) bit of tinkering, I finally came up with this.
VB Code:
Dim a As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly Dim o() As Object = a.GetCustomAttributes(GetType(System.Diagnostics.DebuggableAttribute), True) If o.Length > 0 Then MsgBox("Debug Mode") Else MsgBox("Release Mode") End If
Strange thing is, that when searching in the help, they claim that there is a DefineDebug property, but that's nowhere to be found.
The FileVersionInfo has a IsDebug property, which apparently always returns false, so that's not much use either.
But as far as I can tell, the above solution appears solid.
Enjoy. :wave: