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

Article translations Article translations
Article ID: 935218
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 article 923018, 949730, and 949734.

The following topics are covered:

  • Page 200: Answer B to question 2 is imprecise
  • Page 204: Description of code sample is incorrect
  • Page 209: DictionaryEntry referred to as DictionaryEntries
  • Page 210: Brackets used incorrectly in VB code example
  • Page 213: Incorrect method used for supporting class
  • Page 213: Values property referred to as the Value property
  • Page 214: Code example missing comment
  • Page 215: Code example contains a syntax error
  • Page 216: Incorrect description of Hashtable functionality
  • Page 227: Incorrect VB code used in BitArray example
  • Page 228: Incorrect C# code used in BitArray example
  • Page 228: Four bits referenced in place of three bits
  • Page 230: Bits referred to as bytes
  • Page 230: Unsigned should be signed
  • Page 232: 98314 should be 196634 and 00000000000000011000000000001010 should be 00000000000000110000000000011010
  • Page 234: CollectionsUtil referred to as CollectionUtil
  • Page 235: CollectionsUtil referred to as CollectionUtil
  • Page 235: Incorrect string used in VB and C# code sample
  • Page 237: "++x" should be "x++"
  • Page 238: Incorrect usage of ListCollection class name in Step 3
  • Page 239: CollectionsUtil referred to as CollectionUtil
  • Page 246: KeyValuePair referred to as NameValuePair
  • Page 249: Class referred to as object
  • Page 249: ReverseIntComparison should be AddressOf ReverseIntComparison
  • Page 250: Dictionary referred to as a Queue
  • Page 250: First line of VB code example incorrect
  • Page 254: KeyValuePair referred to as NameValuePair
  • Page 258: ReadOnlyCollectionBase class referred to as ReadOnlyCollection base
  • Page 259: The term "state abbreviations" used in place of "calling codes"
  • Page 263: Incorrect text in Case Scenario 1, question 2
  • Pages 280, 281: "XML" used in place of "SOAP"
  • Page 286: SoapFormatter missing
  • Page 287: serialized used in place of deserialized
  • Page 292: Missing quantity line in sample code
  • Page 301: XML should be Xml
  • Page 305: OnDeserialized should be OnDeserializing
  • Page 306: OnDeserializing should be OnDeserialized
  • Page 343: Image.FromFile shoudl be New Bitmap
  • Page 370: ThreadState.WaitJoinSleep referenced in place of ThreadState.WaitSleepJoin
  • Page 373: Thread referenced in place of value
  • Page 373: Correction in method name and output phrase
  • Page 377: ThreadStart delegate referenced as StartThread
  • Page 378: Missing line break in code sample
  • Page 378: Incorrect code in C# code sample statement
  • Page 380: Domain referenced in place of state
  • Page 383: Include statement referenced in place of using statement
  • Page 383: StartThread referenced in place of ThreadStart
  • Page 387: Interlock class referenced in place of Interlocked class
  • Page 389: Reading from memory referred to as reading into memory
  • Page 390: AddCount method referenced in place of UpdateCount method
  • Page 394: C# code sample is incorrect
  • Page 396: Thread.Sleep method required in code example
  • Page 397: AddressOf missing from code sample
  • Page 407: EventWaitHandles referenced in place of EventWaitHandle
  • Page 410: Interlock class referenced in place of Interlocked class
  • Page 414: Bytes written referenced in place of bytes read
  • Page 415: strm.Read method not required
  • Page 417: AddressOf missing from code sample
  • Page 419: Event referenced in place of class
  • Page 421: QueueWorkItem referenced in place of QueueUserWorkItem
  • Page 421: Extra closing parenthesis included in code sample
  • Page 424: RegisterWaitHandle referenced in place of RegisterWaitForSingleObject
  • Page 429: Thread execution behavior misrepresented
  • Page 432: Case scenario topics misrepresented
  • Page 438: Explanation of ASP.NET worker process incorrect
  • Page 454: VB and C# code samples contain an unnecessary line of code
  • Page 456: Answer D of Question 3 partially incorrect
  • Pages 481-482: Incorrect title on Table
  • Page 483: Configuration should be ConfigurationManager
  • Page 490: Incorrect code sample

More information

Page 200: Answer B to question 2 is imprecise

On page 200, answer B reads:

"To test whether two objects are the same reference of an object"

It should read:

"To test whether two variables are referencing the same object"

Page 204: Description of code sample is incorrect

On page 204, the last sentence before the first code sample reads:

"Once you have an instance of the class, you use the Push method to add items to the queue and the Dequeue method to remove items from the list, as shown in this short example:"

It should read:

"Once you have an instance of the class, you use the Push method to add items to the stack and the Pop method to remove items from the stack, as shown in this short example:"

Page 209: DictionaryEntry referred to as DictionaryEntries

On page 209, the fourth bullet point reads:

"Enumerate dictionaries and know how to use DictionaryEntries."

It should read:

"Enumerate dictionaries and know how to use DictionaryEntry."

Page 210: Brackets used incorrectly in VB code example

On page 210, the VB code example under the second paragraph reads:

' VB
Console.WriteLine(emailLookup["sbishop@contoso.com"])

It should read:

' VB
Console.WriteLine(emailLookup("sbishop@contoso.com"))


Page 213: Incorrect method used for supporting class

On page 213, in the fourth sentence of the first paragraph under "Understanding Equality" reads:

"This class supports the GetHash method, which returns an integer that uniquely identifies the object."

It should read:

"This class supports the GetHashCode method, which returns an integer that uniquely identifies the object."

Page 213: Values property referred to as the Value property

On page 213, the last sentence reads:

"You also could iterate over those values by iterating through the Value property instead, as seen in this example:"

It should read:

"You also could iterate over those values by iterating through the Values property instead, as seen in this example:"

Page 214: Code example missing comment

On page 214, in the second VB code example the 6th line of code is missing a comment.

Change:
Console.WriteLine(duplicates.Count)

To:
Console.WriteLine(duplicates.Count) ' 2

Page 215: Code example contains a syntax error

On page 215, Line 2 of the second VB code example contains a syntax error.

Change:
Dim otherFish as Fish = obj As Fish

To:
Dim otherFish as Fish = TryCast(obj, Fish)

Page 216: Incorrect description of Hashtable functionality

On page 216, the second sentence on the page reads:

"This situation is where the Hashtable’s ability to provide a class that calculates equality comes in."

It should read:

"This situation is where the Hashtable’s ability to use a class that calculates equality comes in."

Page 216: Interfaces referred to as classes

On page 216, the first two sentences of the second paragraph read:

"The Hashtable class supports a constructor that can accept an instance of the IEqualityComparer class as an argument. Much like the IComparer class shown in Lesson 1 that allowed you to sort collections, the IEqualityComparer interface supports two methods: GetHashCode and Equals."

They should read:

"The Hashtable class supports a constructor that can accept an instance of the IEqualityComparer interface as an argument. Much like the IComparer interface shown in Lesson 1 that allowed you to sort collections, the IEqualityComparer interface supports two methods: GetHashCode and Equals."

Page 227: Incorrect VB code used in BitArray example

On page 227, the second part of the VB code in Step 4 reads:

Dim moreBits As BitArray = New BitArray(3)
bits(0) = True
bits(1) = True
bits(2) = False

It should read:

Dim moreBits As BitArray = New BitArray(3)
moreBits(0) = True
moreBits(1) = True
moreBits(2) = False


Page 228: Incorrect C# code used in BitArray example

On page 228: the C# code sample at the top of the page reads:

Dim moreBits = New BitArray(3)
bits[0] = True
bits[1] = True
bits[2] = False

It should read:

Dim moreBits = New BitArray(3)
moreBits[0] = True
moreBits[1] = True
moreBits[2] = False


Page 228: Four bits referenced in place of three bits

On page 228, the second sentence of the third paragraph of the How to Use a BitVector32 for Bit Masks section reads:

"Assume that you need to set the value of the first four bits in some 32-bit integer."

It should read:

"Assume that you need to set the value of the first three bits in some 32-bit integer."

The first sentence of step 4 of the section reads:

"Repeat steps 1 through 3 until you have four bit masks."

It should read:

"Repeat steps 1 through 3 until you have three bit masks."

Page 230: Bits referred to as bytes

On page 230, the eighth sentence of the second paragraph in the Understanding Binary Math section reads:

"So if an unsigned byte has all 8 bytes filled in, it can be represented by this equation: 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255."

It should read:

"So if an unsigned byte has all 8 bits filled in, it can be represented by this equation: 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255."

Page 230: Unsigned should be signed

On page 230, the fourth sentence of the last paragraph in the Understanding Binary Math section refers to an unsigned integer, rather than a signed integer.

Change:
"Complicating matters even more is the fact that the BitVector32 actually works with an unsigned integer, so the last digit is actually –(2^31), which deals with the negative range of a signed 32-bit integer."

To:
"Complicating matters even more is the fact that the BitVector32 actually works with a signed integer, so the last digit is actually –(2^31), which deals with the negative range of a signed 32-bit integer."

Page 232: 98314 should be 196634 and 00000000000000011000000000001010 should be 00000000000000110000000000011010

On page 232, the value of the BitVector32 variable is incorrect.

Change:
"
' VB
Console.WriteLine(packedBits.Data)
' 98314
Console.WriteLine(packedBits)
' BitVector32{00000000000000011000000000001010}
// C#
Console.WriteLine(packedBits.Data);
// 98314
Console.WriteLine(packedBits);
// BitVector32{00000000000000011000000000001010}

You could do the math to figure out that the number 98314 can store 10, 1, and 192, but the BitVector32 can do it for you with much less work."

To:
"
' VB
Console.WriteLine(packedBits.Data)
' 196634

Console.WriteLine(packedBits)
' BitVector32{00000000000000110000000000011010}

// C#
Console.WriteLine(packedBits.Data);
// 196634

Console.WriteLine(packedBits);
// BitVector32{00000000000000110000000000011010}

You could do the math to figure out that the number 196634 can store 10, 1, and 192, but the BitVector32 can do it for you with much less work."

Page 234: CollectionsUtil referred to as CollectionUtil

On page 234, the third sentence of the Case-Insensitive Collections section reads:

"Because this is such a common use, the .NET Framework has a CollectionUtil class that supports creating Hashtable and SortedList objects that are case insensitive."

It should read:

"Because this is such a common use, the .NET Framework has a CollectionsUtil class that supports creating Hashtable and SortedList objects that are case insensitive."

Page 235: CollectionsUtil referred to as CollectionUtil

On page 235, the sixth sentence of the second paragraph reads:

"Unlike case-insensitive collections, CollectionUtil methods cannot be used to create your collections."

It should read:

"Unlike case-insensitive collections, CollectionsUtil methods cannot be used to create your collections."

Page 235: Incorrect string used in VB and C# code sample

On page 235, in the VB and C# code sample it reads:

' VB
Dim hash As Hashtable = New Hashtable( _
StringComparer.InvariantCulture)
Dim list As SortedList = New SortedList( _
StringComparer.InvariantCulture)

// C#
Hashtable hash = new Hashtable(
StringComparer.InvariantCulture);
SortedList list = new SortedList(
StringComparer.InvariantCulture);

It should read:

' VB
Dim hash As Hashtable = New Hashtable( _
StringComparer.InvariantCulture)
Dim list As SortedList = New SortedList( _
StringComparer.InvariantCultureIgnoreCase)

// C#
Hashtable hash = new Hashtable(
StringComparer.InvariantCulture);
SortedList list = new SortedList(
StringComparer.InvariantCultureIgnoreCase);


Page 237: "++x" should be "x++"

On page 237, the fifth line of the last C# code sample is incorrect.

Change:
for (int x = 0; x < nv.Count; ++x)

To:
for (int x = 0; x < nv.Count; x++)

Page 238: Incorrect usage of ListCollection class name in Step 3

On page 238, Step 3 reads:

"In the Main method of the project, create a new instance of the ListCollection class, specifying case insensitive and culture invariant."

It should read:

"In the Main method of the project, create a new instance of the ListDictionary class, specifying case insensitive and culture invariant."

Page 239: CollectionsUtil referred to as CollectionUtil

On page 239, the third bullet point reads:

"You can create case-insensitive versions of Hashtable and SortedList objects using the CollectionUtil class."

It should read:

"You can create case-insensitive versions of Hashtable and SortedList objects using the CollectionsUtil class."

Page 246: KeyValuePair referred to as NameValuePair

On page 246, the last entry on the page in Table 4-20 reads:

"DictionaryEntry NameValuePair<>"

It should read:

"DictionaryEntry KeyValuePair<>"

Page 249: Class referred to as object

On page 249, the sentence after the first code sample reads:

"This approach is a lot easier than writing a whole Comparison object for seldom-used comparisons."

It should read:

"This approach is a lot easier than writing a whole Comparison class for seldom-used comparisons."

Page 249: ReverseIntComparison should be AddressOf ReverseIntComparison

On page 249, the first VB code sample is incorrect.

Change:
' VB
intList.Sort(ReverseIntComparison)

To:
' VB
intList.Sort(AddressOf ReverseIntComparison)


Page 250: Dictionary referred to as a Queue

On page 250, the fourth sentence of the Generic Dictionary Class section reads:

"To use a generic Queue type, you can follow these steps:"

It should read:

"To use a generic Dictionary type, you can follow these steps:"

Page 250: First line of VB code example incorrect

On page 250, the first line of the VB code example reads:

Dictionary(Of Integer, String) dict = new Dictionary(Of Integer, String)() 
dict(3) = "Three" 
dict(4) = "Four" 
dict(1) = "One" 
dict(2) = "Two" 
Dim str as String = dict(3)

It should read:

Dim dict = New Dictionary(Of Integer, String)() 
dict(3) = "Three" 
dict(4) = "Four" 
dict(1) = "One" 
dict(2) = "Two" 
Dim str As String = dict(3)


Page 254: KeyValuePair referred to as NameValuePair

On page 254, the second sentence of the paragraph following Table 4-23 reads:

"This behavior is unlike the generic Dictionary type, where the enumerator returns a generic NameValuePair object."

It should read:

"This behavior is unlike the generic Dictionary type, where the enumerator returns a generic KeyValuePair object."

Page 258: ReadOnlyCollectionBase class referred to as ReadOnlyCollection base

On page 258, the first sentence of the fifth paragraph in the Writing Your Own Collections section reads:

"Unlike the CollectionBase and ReadOnlyCollection base classes, the DictionaryBase implements the IDictionary, IEnumerable, and ICollection interfaces."

It should read:

"Unlike the CollectionBase and ReadOnlyCollectionBase classes, the DictionaryBase implements the IDictionary, IEnumerable, and ICollection interfaces."

Page 259: The term "state abbreviations" used in place of "calling codes"

On page 259, the first sentence in Exercise 1 reads:

"In this exercise, you create a generic Dictionary to hold state abbreviations with their full names."

It should read:

"In this exercise, you create a generic Dictionary to hold calling codes with their full names."

Pages 280, 281: "XML" used in place of "SOAP"

On pages 280 and 281, the title of Table 5-1 reads:

"XML Serialization Attributes"

It should read:

"SOAP Serialization Attributes"

Page 286: SoapFormatter missing

On page 286, answer A to Question 1 omits a reference to SoapFormatter.

Change:
"A. An instance of BinaryFormatter"

To:
"A. An instance of BinaryFormatter or SoapFormatter"

Page 287: serialized used in place of deserialized

On page 287, Question 4 reads:

"Which of the following interfaces should you implement to enable you to run a method after an instance of your class is serialized?"

It should read:

"Which of the following interfaces should you implement to enable you to run a method after an instance of your class is deserialized?"

Page 292: Missing quantity line in sample code

On page 292, the sample code for serializing a class in the middle of the page reads:

<?xml version="1.0" ?>
<ShoppingCartItem>
  <productId>100</productId>
  <price>10.25</price>
  <total>20.50</total>
</ShoppingCartItem>

It should read:

<?xml version="1.0" ?>
<ShoppingCartItem>
  <productId>100</productId>
  <price>10.25</price>
  <total>20.50</total>
  <quantity>2</quantity>
</ShoppingCartItem>


Page 301: XML should be Xml

On page 301, six review question answers use XML rather than Xml.

In the answers to question 2, change:
"B. XMLType
C. XMLElement
D. XMLAttribute"

To:
"B. XmlType
C. XmlElement
D. XmlAttribute"

In the answers to question 4, change:
"A. XMLType
B. XMLIgnore
C. XMLElement
D. XMLAttribute"

To:
"A. XmlType
B. XmlIgnore
C. XmlElement
D. XmlAttribute"

Page 305: OnDeserialized should be OnDeserializing

On page 305, the last sentence references OnDeserialized instead of OnDeserializing.

Change:
"Apply the OnDeserialized attribute to the method that should run during this event."

To:
"Apply the OnDeserializing attribute to the method that should run during this event."

Page 306: OnDeserializing should be OnDeserialized

On page 306, the last sentence of the Deserialized section references OnDeserializing rather than OnDeserialized.

Change:
"Apply the OnDeserializing attribute to the method that should run during this event."

To:
"Apply the OnDeserialized attribute to the method that should run during this event."

Page 343: Image.FromFile shoudl be New Bitmap

On page 343, the second VB code sample uses Image.FromFile rather than New Bitmap.

Change:
"Dim B As Bitmap = Image.FromFile("C:\windows\gone fishing.bmp")"

To:
"Dim B As Bitmap = New Bitmap("C:\windows\gone fishing.bmp")"

Page 370: ThreadState.WaitJoinSleep referenced in place of ThreadState.WaitSleepJoin

On page 370, the description of Interrupt in Table 7-2 reads:

"Raises a ThreadInterruptedException when a thread is in a blocked state (ThreadState.WaitJoinSleep). If the thread never blocks, the interruption never happens."

It should read:

"Raises a ThreadInterruptedException when a thread is in a blocked state (ThreadState.WaitSleepJoin). If the thread never blocks, the interruption never happens."

Page 373: Thread referenced in place of value

On page 373, the last sentence of the first paragraph reads:

"Later on, we will use this thread to see what work is being done on which thread."

It should read:

"Later on, we will use this value to see what work is being done on which thread."

Page 373: Correction in method name and output phrase

On page 373, the first and second sentence of the paragraph below the first set of code examples reads:

"When the Start method is called, the SomeWork method is called on a new thread and the thread executes until the method completes. In this example, our SimpleWork method writes the phrase "In Thread" and shows the ManagedThreadId Property."

It should read:

"When the Start method is called, the SimpleWork method is called on a new thread and the thread executes until the method completes. In this example, our SimpleWork method writes the phrase "Thread #" and shows the ManagedThreadId Property."

Page 377: ThreadStart delegate referenced as StartThread

On page 377, the first three sentences of the Passing Data to Threads section read:

"In each of the earlier examples, we were using the StartThread delegate, which takes no parameters. In most real-world use of threading, you will need to pass information to individual threads. To do this, you need to use a new delegate called ParameterizedStartThread."

They should read:

"In each of the earlier examples, we were using the ThreadStart delegate, which takes no parameters. In most real-world use of threading, you will need to pass information to individual threads. To do this, you need to use a new delegate called ParameterizedThreadStart."

Page 378: Missing line break in code sample

On page 378, the first line of the code sample reads:

' VB ParameterizedThreadStart operation = _

It should read:

' VB 
ParameterizedThreadStart operation = _


Page 378: Incorrect code in C# code sample statement

On page 378, the C# code sample reads:

string info = o as string;
if (info == null)
{
throw InvalidProgramException("Parameter for thread must be a string");
}

It should read:

string info = o as string;
if (info == null)
{
throw new InvalidProgramException("Parameter for thread must be a string");
}


Page 380: Domain referenced in place of state

On page 380, the first sentence on the page reads:

"To solve the problem of leaving objects or the AppDomain in an inconsistent domain, the Thread class has two important static methods: BeginCriticalRegion and EndCriticalRegion."

It should read:

"To solve the problem of leaving objects or the AppDomain in an inconsistent state, the Thread class has two important static methods: BeginCriticalRegion and EndCriticalRegion."

Page 383: Include statement referenced in place of using statement

On page 383, step 3 reads:

"In the new class, add an include statement (or the Imports statement for Visual Basic) to the System.Threading namespace."

It should read:

"In the new class, add a using statement (or the Imports statement for Visual Basic) to the System.Threading namespace."

Page 383: StartThread referenced in place of ThreadStart

On page 383, step 7 reads:

"Go back to the Main method, and create a new StartThread delegate that points to the Counting method."

It should read:

"Go back to the Main method, and create a new ThreadStart delegate that points to the Counting method."

Page 387: Interlock class referenced in place of Interlocked class

On page 387, the first bullet point reads:

"Use the Interlock class to perform atomic operations."

It should read:

"Use the Interlocked class to perform atomic operations."

Page 389: Reading from memory referred to as reading into memory

On page 389, the second sentence of the paragraph preceeding Figure 7-2 reads:

"As shown in Figure 7-2, two threads could each read the values into memory and update them with the same updated value."

It should read:

"As shown in Figure 7-2, two threads could each read the values from memory and at the same time update them with the same updated value."

Page 390: AddCount method referenced in place of UpdateCount method

On page 390, the first sentence after Table 7-7 reads:

"We can change our AddCount method to use the Interlocked class to solve the threading issue like so:"

It should read:

"We can change our UpdateCount method to use the Interlocked class to solve the threading issue like so:"

Page 394: C# code sample is incorrect

On page 394, the C# code sample incorrectly locks on a public instance where it should be private, it also uses an incorrect operator in the _evenCount variable.

Change:
// C#
public void UpdateCount()
{
     lock (this)
     {
          _count = _count + 1;
          if (Count % 2 == 0) // An even number
          {
               _evenCount = _evenCount + 1;
          }
     }
}

To:
//C#
private Object theLock = new Object();

public void UpdateCount()
   {
         lock (theLock)
         {
            _count = _count + 1;
           if (Count % 2 == 0) // An even number
          {
               _evenCount += 1;
          }
     }
}

Page 396: Thread.Sleep method required in code example

On page 396, the C# code example is missing the Thread.Sleep method.

Change:
class Deadlocker
{
	object ResourceA = new Object();
	object ResourceB = new Object();
	public void First()
	{
		lock (ResourceA)
		{
			lock (ResourceB)
			{
				Console.WriteLine("First");
			}
		}
	}
	public void Second()
	{
		lock (ResourceB)
		{
			lock (ResourceA)
			{
				Console.WriteLine("Second");
			}
		}
	}
}

To:
class Deadlocker
{
	object ResourceA = new Object();
	object ResourceB = new Object();
	public void First()
	{
		lock (ResourceA)
		{
			//Added sleep to give enough time for B to launch before A finished.  So deadlock works.
			Thread.Sleep(10);
			lock (ResourceB)
			{
				Console.WriteLine("First");
			}
		}
	}
	public void Second()
	{
		lock (ResourceB)
		{
			//Added sleep to give enough time for A to launch before B finished.  So deadlock works.
			Thread.Sleep(10);
			lock (ResourceA)
			{
				Console.WriteLine("Second");
			}
		}
	}
}

Page 397: AddressOf missing from code sample

On page 397, the third and fourth lines of the Visual Basic code sample are incorrect.

Change:
Dim firstStart As New ThreadStart(deadlock.First)
Dim secondStart As New ThreadStart(deadlock.Second)

To:
Dim firstStart As New ThreadStart(AddressOf deadlock.First)
Dim secondStart As New ThreadStart(AddressOf deadlock.Second)

Page 407: EventWaitHandles referenced in place of EventWaitHandle

On page 407, the third sentence of the final paragraph reads:

"When creating or opening a named event, you will need to deal with EventWaitHandles instead of the AutoResetEvent and ManualResetEvent classes."

It should read:

"When creating or opening a named event, you will need to deal with EventWaitHandle instead of the AutoResetEvent and ManualResetEvent classes."

Page 410: Interlock class referenced in place of Interlocked class

On page 410, the first bullet point reads:

"To perform atomic math operations, use the Interlock class."

It should read:

"To perform atomic math operations, use the Interlocked class."

Page 414: Bytes written referenced in place of bytes read

On page 414, the first sentence of the first paragraph reads:

"The differences include that it returns an IAsyncResult instead of the number of bytes written and that two parameters are added to the method signature to support APM."

It should read:

"The differences include that it returns an IAsyncResult instead of the number of bytes read and that two parameters are added to the method signature to support APM."

The first sentence following the second code sample reads:

"At the end of the operation, you will call the EndRead with the IAsyncResult object and it will return the bytes written."

It should read:

"At the end of the operation, you will call the EndRead with the IAsyncResult object and it will return the bytes read."

Page 415: strm.Read method not required

On page 415, the first line in the C# code sample under the "// Make the asynchronous call" comment is not required.

Remove the following line of code:
strm.Read(buffer, 0, buffer.Length);

Page 417: AddressOf missing from code sample

On page 417, the 10th line in the VB code example is missing AddressOf.

Change:
New AsyncCallBack(CompleteRead), strm)

To:
New AsyncCallBack(AddressOf CompleteRead), strm)

Page 419: Event referenced in place of class

On page 419, the third sentence in the Windows Forms Application Exception Handling box reads:

"You do this by registering for the ThreadException event on the Application event."

It should read:

"You do this by registering for the ThreadException event on the Application class."

Page 421: QueueWorkItem referenced in place of QueueUserWorkItem

On page 421, the first sentence on the page reads:

"Instead of creating a new thread and controlling it, we can use the ThreadPool to do this work by using its QueueWorkItem method:"

It should read:

"Instead of creating a new thread and controlling it, we can use the ThreadPool to do this work by using its QueueUserWorkItem method:"

Page 421: Extra closing parenthesis included in code sample

On page 421, the second code sample reads:

' VB
Dim workItem As New WaitCallback(WorkWithParameter))
If Not ThreadPool.QueueUserWorkItem(workItem,"ThreadPooled") Then
	Console.WriteLine("Could not queue item")
End If

// C#
WaitCallback workItem = new WaitCallback(WorkWithParameter));
if (!ThreadPool.QueueUserWorkItem(workItem, "ThreadPooled"))
{
	Console.WriteLine("Could not queue item");
}

It should read:

' VB
Dim workItem As New WaitCallback(WorkWithParameter)
If Not ThreadPool.QueueUserWorkItem(workItem,"ThreadPooled") Then
	Console.WriteLine("Could not queue item")
End If

// C#
WaitCallback workItem = new WaitCallback(WorkWithParameter);
if (!ThreadPool.QueueUserWorkItem(workItem, "ThreadPooled"))
{
	Console.WriteLine("Could not queue item");
}


Page 424: RegisterWaitHandle referenced in place of RegisterWaitForSingleObject

On page 424, the third sentence of the ThreadPool and WaitHandle section reads:

"This is done by calling the ThreadPool.RegisterWaitHandle, as shown in the following example:"

It should read:

"This is done by calling the ThreadPool.RegisterWaitForSingleObject, as shown in the following example:"

Page 429: Thread execution behavior misrepresented

On page 429, the last sentence of step 8 reads:

"Note that some of the work items are executed on different threads."

It should read:

"Note that some of the work items may be executed on different threads."

Page 432: Case scenario topics misrepresented

On page 432, the first sentence of the Case Scenario section reads:

"In the following case scenarios, you will apply what you’ve learned about how to use application domains and services."

It should read:

"In the following case scenarios, you will apply what you’ve learned about the topics of this chapter."

Page 438: Explanation of ASP.NET worker process incorrect

On page 438, the second sentence in the first paragraph contains inconsistencies with ASP.NET.

Change:
"If 10 people visit an ASP.NET Web site simultaneously, ASP.NET will create a separate application domain for each user."

To:
"In one ASP.NET worker process there will be one application domain per web site. Users of the same web site will all run in the context of the same application domain."

Page 454: VB and C# code samples contain an unnecessary line of code

On page 454, in Step 3 the 2nd line of the VB and C# code is redundant and should be removed.

Remove from VB code:
Dim safeZone As Zone = New Zone(SecurityZone.Internet)

Remove from C# code:
Zone safeZone = new Zone(SecurityZone.Internet);

Page 456: Answer D of Question 3 partially incorrect

On page 456, Answer D of Question 3 reads:

"Create an instance of the AppDomainSetup class, and then set the Application-Base property. Pass the AppDomainSetup object to the AppDomain constructor."

It should read:

"Create an instance of the AppDomainSetup class, and then set the Application-Base property."

Pages 481-482: Incorrect title on Table

On pages 481 and 482 the title of Table 9-1 reads:

"ConfigurationManager Properties and Methods"

It should read:

"Configuration Properties and Methods"

Page 483: Configuration should be ConfigurationManager

On page 483, the title of Table 9-2 is incorrect.

Change:
"Table 9-2 Configuration Properties and Methods"

To:
"Table 9-2 ConfigurationManager Properties and Methods"

Page 490: Incorrect code sample

On page 490, thecode samples are incorrect.

Change:
'VB
Dim AllAppSettings As NameValueCollection = _
	ConfigurationManager.AppSettings
Dim SettingsEnumerator As IEnumerator = AllAppSettings.Keys.GetEnumerator
Dim Counter As Int32 = 0
While SettingsEnumerator.MoveNext
	Console.WriteLine("Item: {0} Value: {1}", _
	AllAppSettings.Keys(Counter), AllAppSettings(Counter))
End While

// C#
NameValueCollection AllAppSettings =
	ConfigurationManager.AppSettings;
Int32 Counter = 0;
IEnumerator SettingsEnumerator = AllAppSettings.Keys.GetEnumerator();
while (SettingsEnumerator.MoveNext())
	{
	Console.WriteLine("Item: {0} Value: {1}", AllAppSettings.Keys[Counter],
	AllAppSettings[Counter]);
	}

To:
'VB
Dim AllAppSettings As NameValueCollection = _
	ConfigurationManager.AppSettings
Dim SettingsEnumerator As IEnumerator = AllAppSettings.Keys.GetEnumerator
Dim Counter As Int32 = 0
While SettingsEnumerator.MoveNext
	Console.WriteLine("Item: {0} Value: {1}", _
	SettingsEnumerator.Current, AllAppSettings(SettingsEnumerator.Current))
End While

// C#
NameValueCollection AllAppSettings =
	ConfigurationManager.AppSettings;
IEnumerator SettingsEnumerator = AllAppSettings.Keys.GetEnumerator();
while (SettingsEnumerator.MoveNext())
	{
	Console.WriteLine("Item: {0}  Value: {1}", SettingsEnumerator.Current, 
	AllAppSettings[(string)SettingsEnumerator.Current]);
	}

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: 935218 - Last Review: June 21, 2014 - Revision: 3.0
Keywords: 
KB935218

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