Is it possible to use a constant defined by the compiler in code like below?
#If DEALER_DEBUG = "ID12345" Then
If(Dealer.ID = DEALER_DEBUG) Then
'Do something
End If
#End If
I'm running batch processes and I'm experiencing problems with one of my customer's data. I want to add special code for only that customer, but I want to keep the code there so I can easily switch the customer ID in the future should i need to debug a different customer.
The source-code of the compiled dll will then look like this:
If(Dealer.ID = "ID12345") Then
'Do something
End If
No. Compiler directives are just that, directives to the compiler. They are not included in the generated IL code, and so cannot be accessed at runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With