Microsoft 9GD00001 Computer Accessories User Manual


 
134 Microsoft Visual Studio 2010: A Beginner’s Guide
namespace. You can also build code that depends on your own custom constants by
adding your own constants to the Conditional Compilation Symbols box as a comma-
separated list of strings.
C# allows you to write code that is classified as unsafe, meaning that you can use
pointers and other features in an unsafe context. Unsafe code is still managed code
(managed by the CLR). However, the CLR can’t verify that the code is safe because
unsafe code can contain pointers. This is an advanced feature and the box is unchecked,
ensuring that you must check it to opt in to enable this type of coding.
All warning messages are associated with a level, and the Warning level is set to 4 by
default, which includes all compiler warnings. Setting this to a lower level would suppress
the display of all warnings at that level or higher. You can also suppress specific warnings
by adding them to a comma-separated list in the Suppress Warnings box. You really
shouldn’t suppress warnings, as this setting could cover up an error that would be hard to
detect otherwise.
When you build an application, your program will run even if warnings are present but
will not run if the compiler encounters errors. Sometimes warnings are so important that
you might want to treat them as errors, and the Treat Warnings As Errors section gives you
flexibility in handling warning-as-error scenarios.
The output path of an application defaults to bin\Debug under the project folder for
Debug builds and bin\Release for release builds. You can change this location if you like.
Checking the XML Documentation file will cause XML Documentation comments
to be extracted from your code into an XML file that you specify. Checking this box
increases the time of the build process, so you won’t necessarily want to leave it on during
Debug builds, when you are doing most of your coding. The XML documentation file can
be input into third-party tools that automatically build technical documentation for you.
You would only check the Register For COM Interop box if you were building a .NET
Assembly that was being called from a COM application.
If you’re doing XML serialization of types in an assembly, you can turn on the Generate
Serialization Assembly to speed the serialization process.
C# has another group of settings on the Build Events tab. You can run code before or
after the build for each project. You can set the conditions upon when the build occurs,
which could be always, on a successful build, or only when an update occurs. The build
events have a set of macros you can access that give you information on the current build
process.
VB has options that are specific to the VB compiler on its Compile page, shown in
Figure 5-11.