Microsoft KB Archive/935218

= MCTS Self-Paced Training Kit (Exam 70-536): Microsoft® .NET Framework 2.0—Application Development Foundation Comments and Corrections Part 2 =

Article ID: 935218

Article Last Modified on 10/4/2007

-

APPLIES TO


 * MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0 - Application Development Foundation, ISBN 0-7356-2277-9

-



SUMMARY
This article contains comments, corrections, and information about known errors relating to the Microsoft Press book MCTS Self-Paced Training Kit (Exam 70-536): Microsoft® .NET Framework 2.0—Application Development Foundation, 0-7356-2277-9. Additional corrections for this book are available in article 923018.

The following topics are covered:


 * Page 512: The first paragraph on the page is not correct
 * Page 529: Incomplete information in step 2 of Lab
 * Pages 544-545: ConfigurationSection needs a custom constructor created
 * Page 546: Configuration class referenced in place of ConfigurationManager class
 * Page 549: Suggested practice heading correction
 * Page 556: Application referenced in place of &quot;event log&quot; in Figure 10-2 caption
 * Pages 564-565: The term methods is used in place of members
 * Page 567: Incorrect description of the Write method of the Debug class
 * Page 568: Incorrect description of the WriteLine method of the Debug class
 * Page 579: Incorrect reference to the previous version of the .NET Framework
 * Page 579: Method referenced in place of attribute
 * Page 582: DelimmedListTraceListener referenced in place of DelimitedListTraceListener
 * Page 582-583: Methods referenced in place of members
 * Page 584: Incorrect configuration file code
 * Page 590: MyListener not added to the Trace.Listeners collection
 * Page 600: The image in Figure 10-13 is incorrect
 * Page 601: The image in Figure 10-14 is incorrect
 * Page 606: this used in place of Me in code sample
 * Page 606: Incorrect variable declaration in second code sample
 * Page 606: tbFileName not used in Process.Start statement in the third code sample
 * Page 607: Incorrect Figure 10-15
 * Page 608: tbUsername used in place of tbUserName
 * Page 612: XmlTextWriterListener should be XmlWriterTraceListener
 * Page 616: &quot;DirectoryObjectSearcher&quot; used in place of &quot;ManagementObjectSearcher&quot;
 * Page 619: IP_Address used in place of IP_Enabled
 * Page 621: Incorrect using directives in step 5
 * Page 733: Managers group referenced in place of Accounting group
 * Page 740: Data.data file referenced in place of Data.dat
 * Page 790: .NET application referenced in place of COM application
 * Page 794: Square brackets used in place of angle brackets
 * Page 799-800: Unneeded using statements in C# code samples
 * Page 815: &quot;Layout.Sequential&quot; used in place of &quot;LayoutKind.Sequential&quot;
 * Page 816: &quot;Layout.Explicit&quot; used in place of &quot;LayoutKind.Explicit&quot;
 * Page 831: Models referenced in place of modules
 * Page 834: Code sample included in the wrong location
 * Page 838: Include statement referenced in place of using statement
 * Page 838: ShowAssembly method referenced in place of ShowAssemblyInfo
 * Page 847: GetCustomAttribute referenced in place of GetCustomAttributes
 * Page 852: Class referenced in place of instance
 * Pages 855-856: InterfaceInfo referenced in place of Type
 * Page 861: Enumeration referenced in place of property
 * Page 864: Include statement referenced in place of using statement
 * Pages 864-865: BindingFlag referenced in place of BindingFlags
 * Page 871: Class referenced in place of method
 * Page 871: Object referenced in place of class
 * Page 872: Include statement referenced in place of using statement
 * Page 876: EventBulder class referenced in place of EventBuilder class
 * Page 879: Class referenced in place of object
 * Page 881: PropertyAttribute referenced in place of PropertyAttributes
 * Page 882: Include statements referenced in place of using statements
 * Page 887: Incorrect scope given for case scenarios
 * Page 924: &quot;CultureType&quot; used in place of &quot;CultureTypes&quot;
 * Page 930: Error in C# in code sample
 * Page 936: Culture class listed incorrectly in first paragraph
 * Page 936: Culture class listed incorrectly in first NOTE section
 * Page 945: Clarification needed for answers B and D for question 2
 * Page 946: Creating items referenced rather than passing them
 * Page 953: Answer explanation incorrect
 * Page 954: Corrections in answers for Lesson 2
 * Page 957: Answer B to question 1 of chapter 3 is incorrect
 * Page 963: Incorrect .NET version referenced in Scenario 2, answer 1
 * Page 977: Reference to question 3 should be removed
 * Page 977: .NET Framework 0 referenced in place of .NET Framework 2.0
 * Page 978: Mapping specification is required for OpenMappedMachineConfiguration
 * Page 980: RemoveLog should be DeleteLog
 * Page 986: SecurityAction.Demand can be used declaratively
 * Page 996: &quot;overcode&quot; used in place of &quot;overcome&quot;
 * Page 1002: SmtpFailedReceipientException should be SmtpFailedRecipientException
 * Page 1002: Answers to Question 1 are partially incorrect
 * Page 1007: The Bitmap glossary entry is not identified as such
 * Page 1007: The Brush glossary entry is not identified as such
 * Page 1009: The Debug and Debugger glossary entries are not identified as such
 * Page 1010: The Graphics glossary entry is not identified as such
 * Page 1011: The LocalService and LocalSystem glossary entries are not identified as such
 * Page 1011: The ManagementQuery glossary entry is not identified as such
 * Page 1012: The NetworkService glossary entry is not identified as such
 * Page 1012: The Pen glossary entry is not identified as such
 * Page 1013: The SoapFormatter glossary entry is not identified as such
 * Page 1014: The StackTrace glossary entry is not identified as such



Page 512: The first paragraph on the page is not correct
On page 512, the first paragraph on the page is a reproduction of the first paragraph on page 448. Please disregard this paragraph.

Page 529: Incomplete information in step 2 of Lab
On page 529, Step 2 of the Lab reads:

&quot;Select the Runtime Security Policy node&quot;

It should read:

&quot;Select the Runtime Security Policy node, and select the Increase Assembly Trust option.&quot;

Pages 544-545: ConfigurationSection needs a custom constructor created
On pages 544-545, steps 7 and 8 read:

&quot;7. Select either the Program.cs or Module1.vb file, and open it. Create a new static/shared method with no return type, and name it WriteSettings, as shown here:

' VB Private Shared Sub WriteSettings End Sub

// C# private static void WriteSettings {};

8. Insert the following code into the method:

' VB Private Shared Sub WriteSettings

Try

Dim LabSection As ConfigurationSection Dim config As _ System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _           ConfigurationUserLevel.None) If config.Sections(&quot;LabSection&quot;) Is Nothing Then LabSection = New ConfigurationSection config.Sections.Add(&quot;LabSection&quot;, ConfigurationSection) customSection.SectionInformation.ForceSave = True config.Save(ConfigurationSaveMode.Full) End If

Catch ex As ApplicationException Console.WriteLine(ex.ToString) End Try End Sub

// C# try {   ConfigurationSection LabSection;

// Get the current configuration file. System.Configuration.Configuration config = ConfigurationManager. OpenExeConfiguration(ConfigurationUserLevel.None);

if (config.Sections[&quot;LabSection&quot;] == null) {       customSection = new ConfigurationSection; config.Sections.Add(&quot;LabSection&quot;, ConfigurationSection); customSection.SectionInformation.ForceSave = true; config.Save(ConfigurationSaveMode.Full); }   } catch (ApplicationException ex) {   Console.WriteLine(ex.ToString); } &quot;

They should read:

&quot;7. Select either the Program.cs or Module1.vb file, and open it. Create a new static/shared method with no return type, and name it WriteSettings, as shown here:

' VB Private Shared Sub WriteSettings End Sub

// C# private static void WriteSettings {};

Create a new public class called CustomSection, as shown here:

' VB Public Class CustomSection Inherits ConfigurationSection End Class

//C# public class CustomSection : ConfigurationSection {   public CustomSection { } }

8. Insert the following code into the method:

' VB Try Dim customSection As CustomSection Dim config As _ System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _   ConfigurationUserLevel.None) If config.Sections(&quot;LabSection&quot;) Is Nothing Then customSection = New CustomSection config.Sections.Add(&quot;LabSection&quot;, customSection) customSection.SectionInformation.ForceSave = True config.Save(ConfigurationSaveMode.Full) End If Catch ex As ApplicationException Console.WriteLine(ex.ToString) End Try

// C# try {   CustomSection customSection;

// Get the current configuration file. System.Configuration.Configuration config = ConfigurationManager. OpenExeConfiguration(ConfigurationUserLevel.None);

if (config.Sections[&quot;LabSection&quot;] == null) {       customSection = new CustomSection; config.Sections.Add(&quot;LabSection&quot;, customSection); customSection.SectionInformation.ForceSave = true; config.Save(ConfigurationSaveMode.Full); }   } catch (ApplicationException ex) {   Console.WriteLine(ex.ToString); } &quot;

Page 546: Configuration class referenced in place of ConfigurationManager class
On page 546, the first Lesson Review questions reads:

&quot;Which methods of the Configuration class are valid ways to open a configuration file? (Choose all that apply.)&quot;

It should read:

&quot;Which methods of the ConfigurationManager class are valid ways to open a configuration file? (Choose all that apply.)&quot;

Page 549: Suggested practice heading correction
On page 549, under the Suggested Practices heading it reads:

&quot;Create a Unit of Isolation for Common Language Runtime within a .NET Framework Application by Using Application Domains&quot;

It should read:

&quot;Embed configuration management functionality into a .NET Framework application.&quot;

Page 556: Application referenced in place of &quot;event log&quot; in Figure 10-2 caption
On page 556, the caption to Figure 10-2 reads:

&quot;The Windows Event Viewer after the Chap10Demo application has been created and written to&quot;

It should read:

&quot;The Windows Event Viewer after the Chap10Demo event log has been created and written to&quot;

Pages 564-565: The term methods is used in place of members
On page 564, the last sentence reads:

&quot;Those methods are listed in Table 10-1.&quot;

It should read:

&quot;Those members are listed in Table 10-1.&quot;

On page 565, the title of Table 10-1 reads:

&quot;Methods of the Debugger Class&quot;

It should read:

&quot;Members of the Debugger Class&quot;

Page 567: Incorrect description of the Write method of the Debug class
On page 567, the description of the Write method in Table 10-2 reads:

&quot;Writes information about attached Debug or Trace class listener objects in the Listeners collection.&quot;

It should read:

&quot;Writes information to attached Debug or Trace class listener objects in the Listeners collection.&quot;

Page 568: Incorrect description of the WriteLine method of the Debug class
On page 568, the description of the WriteLine method in Table 10-2 reads:

&quot;Writes information about attached Debug or Trace class listener objects in the Listeners collection.&quot;

It should read:

&quot;Writes information to attached Debug or Trace class listener objects in the Listeners collection.&quot;

Page 579: Incorrect reference to the previous version of the .NET Framework
On page 579, the fourth sentence of the DebuggerStepThroughAttribute section reads:

&quot;In previous versions of the .NET Framework, every time you created a Winform for instance, this attribute was added to the InitializeComponent method.&quot;

It should read:

&quot;In Visual Basic .NET and Visual Basic 2005, every time you created a Winform for instance, this attribute is applied to the InitializeComponent method.&quot;

Page 579: Method referenced in place of attribute
On page 579, the second sentence of the DebuggerStepThroughAttribute section reads:

&quot;Unlike the DebuggerHiddenAttribute though, this method tells the Debugger to step over the code instead of hiding it from output.&quot;

It should read:

&quot;Unlike the DebuggerHiddenAttribute though, this attribute tells the Debugger to step over the code instead of hiding it from output.&quot;

Page 582: DelimmedListTraceListener referenced in place of DelimitedListTraceListener
On page 582, the second sentence of the Trace Class section reads:

&quot;Visual Studio 2005 has many listener objects built in, including XmlTraceListener, DefaultTraceListener, DelimmedListTraceListener, and EventLogTraceListener.&quot;

It should read:

&quot;Visual Studio 2005 has many listener objects built in, including XmlTraceListener, DefaultTraceListener, DelimitedListTraceListener, and EventLogTraceListener.&quot;

Page 582-583: Methods referenced in place of members
On page 582, the third sentence of the Trace Class section reads:

&quot;A list of the most useful methods is provided in Table 10-4.&quot;

It should read:

&quot;A list of the most useful members is provided in Table 10-4.&quot;

The title for Table 10-4 reads:

&quot;Methods of the Trace Class&quot;

It should read:

&quot;Members of the Trace Class&quot;

On page 583, the first sentence after Table 10-4 reads:

&quot;Because these methods are identical to those discussed in the earlier section about the Debug class or they are self explanatory, let’s move on.&quot;

It should read:

&quot;Because these members are identical to those discussed in the earlier section about the Debug class or they are self explanatory, let’s move on.&quot;

Page 584: Incorrect configuration file code
On page 584, the fourth line of the first code sample reads:



It should read:



Page 590: MyListener not added to the Trace.Listeners collection
On page 590, the code sample for step 4 reads:

' VB Trace.Listeners.Clear Dim MyLog as New EventLog(&quot;Chapter10&quot;, &quot;localhost&quot;, &quot;Chapter10Demo&quot;) Trace.AutoFlush = True Dim MyListener as EventLogTraceListener = new EventLogTraceListener(MyLog) Trace.WriteLine(&quot;This is a test&quot;)

// C# EventLog MyLog = new EventLog(&quot;Chapter10&quot;, &quot;localhost&quot;, &quot;Chapter10Demo&quot;); Trace.AutoFlush = true; EventLogTraceListener MyListener = new EventLogTraceListener(MyLog); Trace.WriteLine(&quot;This is a test&quot;);

It should read:

' VB Trace.Listeners.Clear Dim MyLog as New EventLog(&quot;Chapter10&quot;, &quot;localhost&quot;, &quot;Chapter10Demo&quot;) Trace.AutoFlush = True Dim MyListener as EventLogTraceListener = new EventLogTraceListener(MyLog) Trace.Listeners.Add(MyListener) Trace.WriteLine(&quot;This is a test&quot;)

// C# EventLog MyLog = new EventLog(&quot;Chapter10&quot;, &quot;localhost&quot;, &quot;Chapter10Demo&quot;); Trace.AutoFlush = true; EventLogTraceListener MyListener = new EventLogTraceListener(MyLog); Trace.Listeners.Add(MyListener); Trace.WriteLine(&quot;This is a test&quot;);

Page 600: The image in Figure 10-13 is incorrect
On page 600, the image in Figure 10-13 should be replaced with the image from Figure 10-14 on page 601.

Page 601: The image in Figure 10-14 is incorrect
On page 601, the image in Figure 10-14 should be replaced with the image from Figure 10-15 on page 607.

Page 606: this used in place of Me in code sample
On page 606, the third line of the first code sample reads:

Info.FileName = this.tbProcessName.Text

It should read:

Info.FileName = Me.tbProcessName.Text

Page 606: Incorrect variable declaration in second code sample
On page 606, the third line of the second code sample reads:

String FileName = &quot;C:\ProcessStartDemo.exe&quot;

It should read:

Dim FileName As String = &quot;C:\ProcessStartDemo.exe&quot;

Page 606: tbFileName not used in Process.Start statement in the third code sample
On page 606, the third code sample reads:

' VB Dim SecurePassword As New SecureString For i As Int32 = 0 To Me.tbPassword.Text.Length - 1 SecurePassword.AppendChar(Convert.ToChar(Me.tbPassword.Text(i))) Next Process.Start(Me.tbUserName.Text, Me.tbUserName.Text, SecurePassword, Me.tbDomain.Text)

// C# SecureString SecurePassword = new SecureString; for (Int32 i = 0; i < this.tbPassword.Text.Length; i++) {   SecurePassword.AppendChar(Convert.ToChar(this.tbPassword.Text[i])); } Process.Start(this.tbUserName.Text, this.tbPassword.Text, SecurePassword, this.tbDomain.Text);

It should read:

' VB Dim SecurePassword As New SecureString For i As Int32 = 0 To Me.tbPassword.Text.Length - 1 SecurePassword.AppendChar(Convert.ToChar(Me.tbPassword.Text(i))) Next Process.Start(Me.tbFileName.Text, Me.tbUserName.Text, SecurePassword, Me.tbDomain.Text)

// C# SecureString SecurePassword = new SecureString; for (Int32 i = 0; i < this.tbPassword.Text.Length; i++) {   SecurePassword.AppendChar(Convert.ToChar(this.tbPassword.Text[i])); } Process.Start(this.tbFileName.Text, this.tbUserName.Text, SecurePassword,   this.tbDomain.Text);

Page 607: Incorrect Figure 10-15
On page 607, Figure 10-15 is incorrect. Please disregard this figure.

Page 608: tbUsername used in place of tbUserName
On page 608, the eighth line of the C# code sample reads:

if (this.tbUsername.Text != String.Empty)

It should read:

if (this.tbUserName.Text != String.Empty)

Page 612: XmlTextWriterListener should be XmlWriterTraceListener
On page 612, the fourth sentence in the second bullet point includes an incorrect reference to XmlTextWriterListener.

Change:

&quot;The XmlTextWriterListener allows Debug and Trace output to be written with detailed information stored in predefined Xml attributes.&quot;

To:

&quot;The XmlWriterTraceListener allows Debug and Trace output to be written with detailed information stored in predefined Xml attributes.&quot;

Pages 616: &quot;DirectoryObjectSearcher&quot; used in place of &quot;ManagementObjectSearcher&quot;
On page 616, there are several instances where &quot;DirectoryObjectSearcher&quot; is used in place of &quot;ManagementObjectSearcher&quot;, the first sentence of the paragraph under the Enumerating Management Objects reads:

&quot;At the core of the System.Management namespace is the DirectoryObjectSearcher object, which ccan programmatically access resources through WMI.&quot;

It should read:

&quot;At the core of the System.Management namespace is the ManagementObjectSearcher object, which ccan programmatically access resources through WMI.&quot;

The last sentence of the same paragraph reads:

&quot;To execute a query using the DirectoryObjectSearcher, the following steps need to be performed:&quot;

It should read:

&quot;To execute a query using the ManagementObjectSearcher, the following steps need to be performed:&quot;

Step #2 reads:

&quot;Declare an instance of the DirectoryObjectSearcher class.&quot;

It should read:

&quot;Declare an instance of the ManagementObjectSearcher class.&quot;

Step #5 reads:

&quot;Create a ManagementObjectCollection, and set it to the return value from the DirectoryObjectSearcher's Get method.&quot;

It should read:

&quot;Create a ManagementObjectCollection, and set it to the return value from the ManagementObjectSearcher's Get method.&quot;

Page 619: IP_Address used in place of IP_Enabled
On page 619, the 28th line of the code sample reads:

if (Convert.ToBoolean(DemoManager[IP_Address]) == true)

It should read:

if (Convert.ToBoolean(DemoManager[IP_Enabled]) == true)

Page 621: Incorrect using directives in step 5
On page 621, the C# code sample in step 5 reads:

Using System.Diagnostics; Imports System.Management;

It should read:

using System.Diagnostics; using System.Management;

Page 733: Managers group referenced in place of Accounting group
On page 733, the last sentence reads:

&quot;Even though Mary is a member of the Managers group, and the Managers group has Full Control privileges, the Deny ACE means that all members of the Managers group are denied access to the file.&quot;

It should read:

&quot;Even though Mary is a member of the Managers group, and the Managers group has Full Control privileges, the Deny ACE means that all members of the Accounting group are denied access to the file.&quot;

Page 740: Data.data file referenced in place of Data.dat
On page 740, the code sample reads:

' VB File.Create(&quot;C:\Guest\Data.Data&quot;)

// C# File.Create(@&quot;C:\Guest\Data.Data&quot;);

It should read:

' VB File.Create(&quot;C:\Guest\Data.Dat&quot;)

// C# File.Create(@&quot;C:\Guest\Data.Dat&quot;);

Page 790: .NET application referenced in place of COM application
On page 790, the description of the Type Library Exporter in Table 13-1 reads:

&quot;Creates a COM type library that can be consumed by a .NET application&quot;

It should read:

&quot;Creates a COM type library that can be consumed by a COM application&quot;

Page 794: Square brackets used in place of angle brackets
On page 794, the third line of the code sample reads:

[assembly: RuntimeCompatibility(WrapNonExceptionThrows=false)]

It should read:



Page 799-800: Unneeded using statements in C# code samples
On pages 799-800, the first three lines of the C# code sample reads:

using System; using System.Collections.Generic; using System.Text;

These lines should be removed.

Page 815: &quot;Layout.Sequential&quot; used in place of &quot;LayoutKind.Sequential&quot;
On page 815, the bold section header near the middle of the page reads:

&quot;Layout.Sequential&quot;

It should read:

&quot;LayoutKind.Sequential&quot;

The first sentence under the Layout.Sequential section heading reads:

&quot;The first method to use is the Layout.Sequential option.&quot;

It should read:

&quot;The first method to use is the LayoutKind.Sequential option.&quot;

Page 816: &quot;Layout.Explicit&quot; used in place of &quot;LayoutKind.Explicit&quot;
On page 816, the section heading at the top of the page reads:

&quot;Layout.Explicit&quot;

It should read:

&quot;LayoutKind.Explicit&quot;

Page 831: Models referenced in place of modules
On page 831, the third sentence reads:

&quot;From assemblies and models all the way down to the individual statements that are part of a line of code, reflection allows you to both interrogate and generate code in .NET.&quot;

It should read:

&quot;From assemblies and modules all the way down to the individual statements that are part of a line of code, reflection allows you to both interrogate and generate code in .NET.&quot;

Page 834: Code sample included in the wrong location
On page 834, the second and third paragraphs read:

&quot;More interesting are the GetCallingAssembly, GetEntryAssembly, and GetExecutingAssembly calls. These methods allow you to retrieve an instance of the Assembly class for assemblies that are part of the current call stack. GetEntryAssembly returns an instance of the assembly that contains the start-up method (usually the executable assembly for a desktop application), as shown in the following example:

' VB Dim theAssembly As Assembly = Assembly.GetExecutingAssembly

// C# Assembly theAssembly = Assembly.GetExecutingAssembly;

You can retrieve the assembly for the currently running code by calling GetExecutingAssembly. In contrast, the GetCallingAssembly retrieves an instance of the Assembly class for the method one level up in the call stack. In other words, it retrieves the assembly that contains the method that called the currently executing code.&quot;

They should read:

&quot;More interesting are the GetCallingAssembly, GetEntryAssembly, and GetExecutingAssembly calls. These methods allow you to retrieve an instance of the Assembly class for assemblies that are part of the current call stack. GetEntryAssembly returns an instance of the assembly that contains the start-up method (usually the executable assembly for a desktop application).

You can retrieve the assembly for the currently running code by calling GetExecutingAssembly. In contrast, the GetCallingAssembly retrieves an instance of the Assembly class for the method one level up in the call stack. In other words, it retrieves the assembly that contains the method that called the currently executing code. See the following example:

' VB Dim theAssembly As Assembly = Assembly.GetExecutingAssembly

// C# Assembly theAssembly = Assembly.GetExecutingAssembly; &quot;

Page 838: Include statement referenced in place of using statement
On page 838, step 2 reads:

&quot;Add an include statement (or the Imports statement for Visual Basic) to the System.Reflection namespace to the main code file.&quot;

It should read:

&quot;Add a using statement (or the Imports statement for Visual Basic) to the System.Reflection namespace to the main code file.&quot;

Page 838: ShowAssembly method referenced in place of ShowAssemblyInfo
On page 838, steps 3, 4, 7 and 9 read:

&quot;3. Create a new static method called ShowAssembly that takes an instance of the Assembly class as a parameter.

4. Inside the new ShowAssembly method, write out the FullName, GlobalAssemblyCache, Location, and ImageRuntimeVersion properties to the console.

7. Call the ShowAssembly method with the new assembly instance.

9. Call the ShowAssembly method again with this instance of the Assembly instance from the executing assembly. Your code might look something like this:&quot;

They should read:

&quot;3. Create a new static method called ShowAssemblyInfo that takes an instance of the Assembly class as a parameter.

4. Inside the new ShowAssemblyInfo method, write out the FullName, GlobalAssemblyCache, Location, and ImageRuntimeVersion properties to the console.

7. Call the ShowAssemblyInfo method with the new assembly instance.

9. Call the ShowAssemblyInfo method again with the Assembly instance from the executing assembly. Your code might look something like this:&quot;

Page 847: GetCustomAttribute referenced in place of GetCustomAttributes
On page 847, the sixth sentence of the Getting Assembly Attributes section reads:

&quot;Because of this, the GetCustomAttribute allows for a Boolean value to indicate whether to get inherited attributes.&quot;

It should read:

&quot;Because of this, the GetCustomAttributes allows for a Boolean value to indicate whether to get inherited attributes.&quot;

Page 852: Class referenced in place of instance
On page 852, the sentence following the bulleted list in the Getting Types section reads:

&quot;When working with an Assembly class, you can ask it for all the Types in all the modules of the assembly by calling the GetTypes method:&quot;

It should read:

&quot;When working with an Assembly instance, you can ask it for all the Types in all the modules of the assembly by calling the GetTypes method:&quot;

Pages 855-856: InterfaceInfo referenced in place of Type
On page 855, the description for GetInterface in Table 14-8 reads:

&quot;Retrieves a specific InterfaceInfo object that is associated with this Type&quot;

It should read:

&quot;Retrieves a specific Type object that is associated with this Type&quot;

On page 856, the description for GetInterfaces in Table 14-8 reads:

&quot;Retrieves all the InterfaceInfo objects that are associated with this Type&quot;

It should read:

&quot;Retrieves all the Type objects that are associated with this Type&quot;

Page 861: Enumeration referenced in place of property
On page 861, the first two sentences following Table 14-9 read:

&quot;You can see the type of member each of these MemberInfo objects is by checking the MemberType enumeration on the MemberInfo class. This enumeration contains all the different types of members that a MemberInfo object can represent.&quot;

They should read:

&quot;You can see the type of member each of these MemberInfo objects is by checking the MemberType property on the MemberInfo class. This property contains an enumeration value that can represent all the different types of members that a MemberInfo object can represent.&quot;

Page 864: Include statement referenced in place of using statement
On page 864, step 2 reads:

&quot;Add an include statement (or Imports in Visual Basic) to the System.Reflection namespace to the main code file.&quot;

It should read:

&quot;Add a using statement (or Imports in Visual Basic) to the System.Reflection namespace to the main code file.&quot;

Pages 864-865: BindingFlag referenced in place of BindingFlags
On pages 864, step 4 reads:

&quot;Create a local BindingFlag variable, and store the flags to get only declared, public instance members.&quot;

It should read:

&quot;Create a local BindingFlags variable, and store the flags to get only declared, public instance members.&quot;

On page 865, step 10 reads:

&quot;Continue inside the iteration loop, and get all the members from each type using the BindingFlag variable from step 4.&quot;

It should read:

&quot;Continue inside the iteration loop, and get all the members from each type using the BindingFlags variable from step 4.&quot;

Page 871: Class referenced in place of method
On page 871, the first sentence following the first code sample reads:

&quot;In this example, you are getting the MethodInfo for the overload of the WriteLine class that takes a single String and writes it out to the console.&quot;

It should read:

&quot;In this example, you are getting the MethodInfo for the overload of the WriteLine method that takes a single String and writes it out to the console.&quot;

Page 871: Object referenced in place of class
On page 871, the first sentence following the second code sample reads:

&quot;Because this is a static method, you specify a null in the parameter that would ordinarily take the instance of the object on which to run the method.&quot;

It should read:

&quot;Because this is a static method, you specify a null in the parameter that would ordinarily take the instance of the class on which to run the method.&quot;

Page 872: Include statement referenced in place of using statement
On page 872, step 2 reads:

&quot;In the main code file, add an include statement (or Imports for Visual Basic) to the System.Reflection namespace.&quot;

It should read:

&quot;In the main code file, add a using statement (or Imports for Visual Basic) to the System.Reflection namespace.&quot;

Page 876: EventBulder class referenced in place of EventBuilder class
On page 876, the fourth name in Table 14-11 reads:

&quot;EventBulder&quot;

It should read:

&quot;EventBuilder&quot;

Page 879: Class referenced in place of object
On page 879, the first sentence of the Creating Members section reads:

&quot;The TypeBuilder class that the DefineType method returns is central to creating dynamic code.&quot;

It should read:

&quot;The TypeBuilder object that the DefineType method returns is central to creating dynamic code.&quot;

Page 881: PropertyAttribute referenced in place of PropertyAttributes
On page 881, the first sentence following the third code sample reads:

&quot;Although defining the property is much like defining a method, the PropertyAttribute enumeration does not allow defining as many aspects of the properties as you might expect.&quot;

It shoulld read:

&quot;Although defining the property is much like defining a method, the PropertyAttributes enumeration does not allow defining as many aspects of the properties as you might expect.&quot;

Page 882: Include statements referenced in place of using statements
On page 882, step 2 reads:

&quot;In the main code file, add include statements (or Imports statements for Visual Basic) for System.Reflection and System.Reflection.Emit namespaces.&quot;

It should read:

&quot;In the main code file, add using statements (or Imports statements for Visual Basic) for System.Reflection and System.Reflection.Emit namespaces.&quot;

Page 887: Incorrect scope given for case scenarios
On page 887, the first sentence reads:

&quot;In the following case scenario, you will apply what you’ve learned about how to use application domains and services.&quot;

It should read:

&quot;In the following case scenario, you will apply what you’ve learned about the topics of this chapter.&quot;

Page 924: &quot;CultureType&quot; used in place of &quot;CultureTypes&quot;
On page 924, the last sentence on the page reads:

&quot;The GetCultures method takes a single parameter of type CultureType.&quot;

It should read:

&quot;The GetCultures method takes a single parameter of type CultureTypes.&quot;

Page 930: Error in C# in code sample
On page 930, the first line in the second C# code snippet on page 930 reads:

CompareInfo DemoInfo = Thread.CurrentThread.CurrentCulture.CompareInfo;

It should read:

CompareInfo DemoInfo = new CultureInfo(“en-US”).CompareInfo;

Page 936: Culture class listed incorrectly in first paragraph
On page 936, the third sentence in the first paragraph reads:

&quot;The CultureRegionAndInfoBuilder class enables you to create and use a customized culture.&quot;

It should read:

&quot;The CultureAndRegionInfoBuilder class enables you to create and use a customized culture.&quot;

Page 936: Culture class listed incorrectly in first NOTE section
On page 936, under the NOTE .NET 2.0 section it reads:

&quot;The CultureRegionAndInfoBuilder class is new in .NET 2.0&quot;

It should read:

&quot;The CultureAndRegionInfoBuilder class is new in .NET 2.0&quot;

Page 945: Clarification needed for answers B and D for question 2
On page 945, answers B and D for question 2 read:

&quot;B. Correct: Procedures work with a copy of variables when you pass a value type. Therefore, any modifications that were made to the copy would not affect the original value. D. Incorrect: If the variable had been a reference, the original value would have been modified.&quot;

They should read:

&quot;B. Correct: Procedures work with a copy of variables when you pass a value type by value. Therefore, any modifications that were made to the copy would not affect the original value. D. Incorrect: If the variable had been passed by reference, the original value would have been modified.&quot;

Page 946: Creating items referenced rather than passing them
On page 946, the answers to question 4 read:

&quot;A. Incorrect: You could create a reference class; however, it could be modified when passed to a procedure.

B. Incorrect: You cannot create a reference structure.

C. Incorrect: You could create a value class; however, structures tend to be more efficient.

D. Correct: Value structures are typically the most efficient.&quot;

They should read:

&quot;A. Incorrect: You could pass a class by reference; however, it could be modified when passed to a procedure.

B. Incorrect: You could pass a structure by reference; however, it could be modified when passed to a procedure.

C. Incorrect: You could pass a class by value; however passing structures by value tend to be more efficient.

D. Correct: Structures passed by value are typically the most efficient.&quot;

Page 953: Answer explanation incorrect
On page 953, Chapter 3, Lesson 1, Question 2 answer A reads:

&quot;A. Correct: ISerializable is an interface that you can implement to perform custom serialization. It is not an attribute.&quot;

It should read:

&quot;A. Correct: This code sample works correctly by using the RegexOptions.Multiline option to process multiline input.&quot;

Page 954: Corrections in answers for Lesson 2
On page 954, Chapter 3, Lesson 2, Question 1 answers B through D read:

&quot;B. Incorrect: UTF-16 has a smaller byte size than UTF-3

C. Incorrect: UTF-8 has a smaller byte size than UTF-3

D. Incorrect: ASCII has a smaller byte size than UTF-3&quot;

It should read:

&quot;B. Incorrect: UTF-16 has a smaller byte size than UTF-32

C. Incorrect: UTF-8 has a smaller byte size than UTF-32

D. Incorrect: ASCII has a smaller byte size than UTF-32&quot;

Page 957: Answer B to question 1 of chapter 3 is incorrect
On page 957, the answer given for question 1 of Chapter 3 is incorrect.

Change:

&quot;1. Correct Answers: B and D

A. Incorrect: GetType is not called to determine uniqueness.

B. Correct: The hash value from the object is used to see whether the hash has been used in the collection.

C. Incorrect: The string representation of the object does not determine whether the key is unique. The Hashtable class only uses the hash value to determine uniqueness.

D. Correct: If two hash values are identical, Equals can be called to determine whether two objects are in fact equal before assigning the value to a key.&quot;

To:

&quot;1. Correct Answer: D

A. Incorrect: GetType is not called to determine uniqueness.

B. Incorrect: The hash value from the object is used to see whether the hash has been used in the collection, but does not indicate whether the object has been used as a key.

C. Incorrect: The string representation of the object does not determine whether the key is unique. The Hashtable class only uses the hash value to determine uniqueness.

D. Correct: If two hash values are identical, Equals can be called to determine whether two objects are in fact equal before assigning the value to a key.&quot;

Page 963: Incorrect .NET version referenced in Scenario 2, answer 1
On page 963, Answer 1 for Case Scenario 2 reads:

&quot;Yes, BinaryFormatter can deserialize objects serialized with .NET 0.&quot;

It should read:

&quot;Yes, BinaryFormatter can deserialize objects serialized with .NET 1.0.&quot;

Page 977: Reference to question 3 should be removed
On page 977, the answer to chapter 9, lesson 2, question 3 reads:

&quot;3. Correct Answer: D

A. Incorrect: The Custom Actions view is used to facilitate custom actions along the installation path. It has no true bearing on the registry.

B. Incorrect: The File System view is used to facilitate changes to the file system. It has no real control over the registry.

C. Incorrect: There is no Registry Editor view.

D. Correct: The Registry view is the correct view to allow additions and modifications to the registry.&quot;

This text should be disregarded.

Page 977: .NET Framework 0 referenced in place of .NET Framework 2.0
On page 977, answers A and B to lesson 3, question 1 read:

&quot;A. Incorrect: Processes can be viewed with the Process class but not with the .NET Framework 0 Configuration tool.

B. Incorrect: Services cannot be viewed with the .NET Framework 0 Configuration tool.&quot;

They should read:

&quot;A. Incorrect: Processes can be viewed with the Process class but not with the .NET Framework 2.0 Configuration tool.

B. Incorrect: Services cannot be viewed with the .NET Framework 2.0 Configuration tool.&quot;

Page 978: Mapping specification is required for OpenMappedMachineConfiguration
On page 978, lesson 4, question 1, answer D reads:

&quot;Correct: OpenMappedMachineConfiguration is a valid method to open the machine configuration file.&quot;

It should read:

&quot;Correct: OpenMappedMachineConfiguration is a valid method to open a machine configuration file as long as a mapping is specified.&quot;

Page 980: RemoveLog should be DeleteLog
On page 980, answer D to question 4 refers to RemoveLog rather than DeleteLog.

Change:

&quot;D. Incorrect: There is no RemoveLog method of the EventLog class.&quot;

To:

&quot;D. Incorrect: There is no DeleteLog method of the EventLog class.&quot;

Page 986: SecurityAction.Demand can be used declaratively
On page 986, the first answer for Chapter 11, Lesson 3, Question 2 reads:

&quot;A. Incorrect: SecurityAction.Demand instructs the runtime to throw and exception if the caller and all callers higher in the stack lack the specified permissions. However, SecurityAction.Demand must be used imperatively, and the question describes a need for declarative security.&quot;

It should read:

&quot;A. Correct: SecurityAction.Demand instructs the runtime to throw and exception if the caller and all callers higher in the stack lack the specified permissions.&quot;

Page 996: &quot;overcode&quot; used in place of &quot;overcome&quot;
On page 996, in Question 2, Answer A, the second sentence reads:

&quot;Although the types might vary, the MarshalAs method can be used to overcode this.&quot;

It should read:

&quot;Although the types might vary, the MarshalAs method can be used to overcome this.&quot;

Page 1002: SmtpFailedReceipientException should be SmtpFailedRecipientException
On page 1002, Lesson 2, Question 3, Answer A includes a mispelling of the exception.

Change:

&quot;A. Correct: The runtime throws SmtpFailedReceipientException if the SMTP server rejects an e-mail address.&quot;

To:

&quot;A. Correct: The runtime throws SmtpFailedRecipientException if the SMTP server rejects an e-mail address.&quot;

Page 1002: Answers to Question 1 are partially incorrect
On page 1002, the answer to Question 1 of Lesson 2 is incorrect and the explanations of the other answers are partially incorrect.

Change:

&quot;1. Correct Answer: B

A. Incorrect: The MailMessage class does not have a Send method.

B. Correct: To send a message, create an instance of SmtpClient and call the Send method.

C. Incorrect: There is no SmtpServer class.

D. Incorrect: There is no MailClient class.&quot;

To:

&quot;1. Correct Answer: C

A. Incorrect: The MailMessage class does not have a Send method.

B. Incorrect: SmtpClient.Send does not wait for the transmission to complete before proceeding.

C. Correct: SmtpClient.SendAsync sends an e-mail message and then waits for the transmission to complete before proceeding.

D. Incorrect: There is no MailMessage class.&quot;

Page 1007: The Bitmap glossary entry is not identified as such
On page 1007, the third-to-last entry on the page reads:

&quot;Located in the System.Drawing namespace, this class provides methods for loading and saving images, and editing individual pixels.&quot;

It should read:

&quot;Bitmap Located in the System.Drawing namespace, this class provides methods for loading and saving images, and editing individual pixels.&quot;

Page 1007: The Brush glossary entry is not identified as such
On page 1007, the last entry on the page reads:

&quot;Located in the System.Drawing namespace, classes derived from the Brush class are required for drawing text and filling in shapes.&quot;

It should read:

&quot;Brush Located in the System.Drawing namespace, classes derived from the Brush class are required for drawing text and filling in shapes.&quot;

Page 1009: The Debug and Debugger glossary entries are not identified as such
On page 1009, the two entries below &quot;Data Encryption Standard (DES)&quot; read:

&quot;A specific constant defined in an application that allows Debugger objects to be attached to code.

A class that provides access to the default debugger attached to an application.&quot;

They should read:

&quot;Debug A specific constant defined in an application that allows

Debugger objects to be attached to code. Debugger A class that provides access to the default debugger attached to an application.&quot;

Page 1010: The Graphics glossary entry is not identified as such
On page 1010, the entry after globalization reads:

&quot;Located in the System.Drawing namespace, this class provides methods for drawing lines, shapes, and text.&quot;

It should read:

&quot;Graphics Located in the System.Drawing namespace, this class provides methods for drawing lines, shapes, and text.&quot;

Page 1011: The LocalService and LocalSystem glossary entries are not identified as such
On page 1011, the two entries after &quot;localization&quot; read:

&quot;A service account that runs with very limited privileges.

A service account that runs with almost unlimited privileges.&quot;

They should read:

&quot;LocalService A service account that runs with very limited privileges.

LocalSystem A service account that runs with almost unlimited privileges.&quot;

Page 1011: The ManagementQuery glossary entry is not identified as such
On page 1011, the entry after &quot;managed code&quot; reads:

&quot;A request for information about a Windows Management Instrumentation object.&quot;

It should read:

&quot;ManagementQuery A request for information about a Windows Management Instrumentation object.&quot;

Page 1012: The NetworkService glossary entry is not identified as such
On page 1012, the entry after &quot;.NET Framework 2.0 Configuration tool&quot; reads:

&quot;A service account that is capable of authenticating to remote computers.&quot;

It should read:

&quot;NetworkService A service account that is capable of authenticating to remote computers.&quot;

Page 1012: The Pen glossary entry is not identified as such
On page 1012, the entry after &quot;partially trusted code&quot; reads:

&quot;Located in the System.Drawing namespace, this class is used to specify the color and width of drawings.&quot;

It should read:

&quot;Pen Located in the System.Drawing namespace, this class is used to specify the color and width of drawings.&quot;

Page 1013: The SoapFormatter glossary entry is not identified as such
On page 1013, the second-to-last entry on the page reads:

&quot;Located in the System.Runtime.Serialization.Formatters.Soap namespace, this XMLbased formatter is the most reliable way to serialize objects that will be transmitted across a network or read by non–.NET Framework applications. SoapFormatter is more likely to successfully traverse firewalls than BinaryFormatter.&quot;

It should read:

&quot;SoapFormatter Located in the System.Runtime.Serialization.Formatters.Soap namespace, this XMLbased formatter is the most reliable way to serialize objects that will be transmitted across a network or read by non–.NET Framework applications. SoapFormatter is more likely to successfully traverse firewalls than BinaryFormatter.&quot;

Page 1014: The StackTrace glossary entry is not identified as such
On page 1014, the second entry ont he page reads:

&quot;An ordered collection of one or more StackFrame objects.&quot;

It should read:

&quot;StackTrace An ordered collection of one or more StackFrame objects.&quot;

Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.

Additional query words: 0-7356-2277-9 978-0-7356-2277-7

Keywords: KB935218

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.