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

Article translations Article translations
Article ID: 949730
Expand all | Collapse all

On This Page

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 articles 923018, 935218, and 949734.

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 "event log" 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: "DirectoryObjectSearcher" used in place of "ManagementObjectSearcher"
  • Page 619: IP_Address used in place of IP_Enabled
  • Page 621: Incorrect using directives in step 5

More information

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:

"Select the Runtime Security Policy node"

It should read:

"Select the Runtime Security Policy node, and select the Increase Assembly Trust option."

Pages 544-545: ConfigurationSection needs a custom constructor created

On pages 544-545, steps 7 and 8 read:

"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("LabSection") Is Nothing Then
			LabSection = New ConfigurationSection()
			config.Sections.Add("LabSection", 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["LabSection"] == null)
		{
		customSection = new ConfigurationSection();
		config.Sections.Add("LabSection", ConfigurationSection);
		customSection.SectionInformation.ForceSave = true;
		config.Save(ConfigurationSaveMode.Full);
		}
	}
catch (ApplicationException ex)
	{
	Console.WriteLine(ex.ToString());
	}
"

They should read:

"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("LabSection") Is Nothing Then
		customSection = New CustomSection()
		config.Sections.Add("LabSection", 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["LabSection"] == null)
		{
		customSection = new CustomSection();
		config.Sections.Add("LabSection", customSection);
		customSection.SectionInformation.ForceSave = true;
		config.Save(ConfigurationSaveMode.Full);
		}
	}
catch (ApplicationException ex)
	{
	Console.WriteLine(ex.ToString());
	}
"

Page 546: Configuration class referenced in place of ConfigurationManager class

On page 546, the first Lesson Review questions reads:

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

It should read:

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

Page 549: Suggested practice heading correction

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

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

It should read:

"Embed configuration management functionality into a .NET Framework application."

Page 556: Application referenced in place of "event log" in Figure 10-2 caption

On page 556, the caption to Figure 10-2 reads:

"The Windows Event Viewer after the Chap10Demo application has been created and written to"

It should read:

"The Windows Event Viewer after the Chap10Demo event log has been created and written to"

Pages 564-565: The term methods is used in place of members

On page 564, the last sentence reads:

"Those methods are listed in Table 10-1."

It should read:

"Those members are listed in Table 10-1."

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

"Methods of the Debugger Class"

It should read:

"Members of the Debugger Class"

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:

"Writes information about attached Debug or Trace class listener objects in the Listeners collection."

It should read:

"Writes information to attached Debug or Trace class listener objects in the Listeners collection."

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:

"Writes information about attached Debug or Trace class listener objects in the Listeners collection."

It should read:

"Writes information to attached Debug or Trace class listener objects in the Listeners collection."

Page 579: Incorrect reference to the previous version of the .NET Framework

On page 579, the fourth sentence of the DebuggerStepThroughAttribute section reads:

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

It should read:

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

Page 579: Method referenced in place of attribute

On page 579, the second sentence of the DebuggerStepThroughAttribute section reads:

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

It should read:

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

Page 582: DelimmedListTraceListener referenced in place of DelimitedListTraceListener

On page 582, the second sentence of the Trace Class section reads:

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

It should read:

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

Page 582-583: Methods referenced in place of members

On page 582, the third sentence of the Trace Class section reads:

"A list of the most useful methods is provided in Table 10-4."

It should read:

"A list of the most useful members is provided in Table 10-4."

The title for Table 10-4 reads:

"Methods of the Trace Class"

It should read:

"Members of the Trace Class"

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

"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."

It should read:

"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."

Page 584: Incorrect configuration file code

On page 584, the fourth line of the first code sample reads:

<add name="DemoApp" value="2" />

It should read:

<add name="DemoApp.Switch" value="Information"/>


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("Chapter10", "localhost", "Chapter10Demo")
Trace.AutoFlush = True
Dim MyListener as EventLogTraceListener = new EventLogTraceListener(MyLog)
Trace.WriteLine("This is a test")

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

It should read:

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

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


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 = "C:\ProcessStartDemo.exe"

It should read:

Dim FileName As String = "C:\ProcessStartDemo.exe"


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:
"The XmlTextWriterListener allows Debug and Trace output to be written with detailed information stored in predefined Xml attributes."

To:
"The XmlWriterTraceListener allows Debug and Trace output to be written with detailed information stored in predefined Xml attributes."

Pages 616: "DirectoryObjectSearcher" used in place of "ManagementObjectSearcher"

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

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

It should read:

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

The last sentence of the same paragraph reads:

"To execute a query using the DirectoryObjectSearcher, the following steps need to be performed:"

It should read:

"To execute a query using the ManagementObjectSearcher, the following steps need to be performed:"

Step #2 reads:

"Declare an instance of the DirectoryObjectSearcher class."

It should read:

"Declare an instance of the ManagementObjectSearcher class."

Step #5 reads:

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

It should read:

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

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;


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.

Properties

Article ID: 949730 - Last Review: June 21, 2014 - Revision: 2.0
Keywords: 
KB949730

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com