OHM,
#If DemoVersion Then
' save not allowed
#Else
' save allowed in the purchased version
#End If
Where you build two versions of your assembly, the Demo & the Purchased
version (conceptionally 4 versions: Release Demo, Release Purchased, Debug
Demo, and Debug Purchased).
Also if it wasn't mentioned in this thread the ConditionalAttribute is
handy.
<Conditional("FullVersion")> _
Public Sub FileSave()
#If FullVersion
' code to save a file only used in Full Version
#End If
End Sub
Then you can simply call FileSave and the call will be conditionally
included in your assembly, this is how all the methods on Debug & Trace
work, they all have a <Conditional("DEBUG")> attribute on them.
The #If FullVersion will remove the method body if you so choose...
Hope this helps
Jay
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:uo**************@TK2MSFTNGP11.phx.gbl...
I had not used this. Interesting, however, Im not sure why this might be
favourable to simply using #If Debug, perhaps you can illuminate ?
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
Time flies when you don't know what you're doing
"Bruin" <Br***@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com... Bruin,
Another equivalent way to do this is to use custom constants. Within
the build configuration properties of a projects properties under the build
sub menu you can also define custom constants and their values to be used in
the same way. By using a custom constant instead of the built in debug flag
I am able to change the behavior in either debug or release mode.
For Example in the custom constants field (Debug configuration) enter
SkipAnnoyingTasks=True you can then use the same login
#IF SkipAnnoyingTasks=false
'prompt for credentials
#end if
"Herfried K. Wagner [MVP]" wrote:
* "Tom" <an*******@discussions.microsoft.com> scripsit:
> How can I make code not execute for a debug build, but do
> execute for a production build?
\\\
#If DEBUG THen
...
#Else
...
#End If
///
In the project properties, make sure the checkbox that defines the
'DEBUG' constant is checked.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>