Start by opening the Properties dialog box for your ASP.NET project. Select Configuration Properties and then select Build. In the bottom half of the dialog box, you should see mention of the Conditional Compilation Constants you seek. Note that two are predefined: DEBUG and TRACE. There's also a field where you can define your own constants.
To mark a procedure so that it will respect a defined constant, simply reference the Conditional field in your procedure declaration, as shown here:
<Conditional(“StagingServer”)> Sub MyProc()
‘Code that might need to be ignored
End Sub
If the constant was set in the project’s properties, then it will be excluded—simple as that! And, even the calls to the excluded code will be excluded themselves.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.