Microsoft KB Archive/923018

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

Article ID: 923018

Article Last Modified on 11/7/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 935218.

The following topics are covered:


 * CD-ROM: &quot;not&quot; should be removed from assessment question
 * CD-ROM: Assessment answer should include ICollection and not IDictionaryEnumerator
 * CD-ROM: Assessment answer should also include Resize event
 * CD-ROM: lesson3-exercise1-Person-partial code samples are missing from \Chapter01 folder
 * Page 3: System.Value referenced rather than System.ValueType
 * Page 5: Date/date should be Date/none
 * Page 5: 4 should be 1
 * Page 9: NOTE is incorrect
 * Page 12: Term &quot;defines&quot; used in place of &quot;initializes&quot; in step 4
 * Page 14: Term &quot;class&quot; used in place of term &quot;structure&quot; in step 5
 * Page 18: The word &quot;variable&quot; is missing from the final sentence
 * Page 24: C# code sample missing
 * Page 25: Incorrect code in C# example
 * Page 46: Correction in code example
 * Page 47: &quot;Guide&quot; used in place of &quot;Guid&quot;
 * Page 51: Methods incorrectly named
 * Page 52: &quot;progressBar&quot; used in place of &quot;progressBar1&quot; in code sample
 * Page 55: Incorrect description of narrowing conversion behavior
 * Page 58: Incorrect index used in the second code sample
 * Page 59: Decimal used in place of Double in code for Exercise 1
 * Page 63: &quot;narrowing&quot; used in place of &quot;widening&quot;
 * Page 72: &quot;Exist property&quot; referenced in place of &quot;Exists property&quot;
 * Page 73: string should be DirectoryInfo object
 * Page 74: DriveInfo class described incorrectly
 * Page 76: Unknown member description is missing the word &quot;type&quot;
 * Page 76: Procedure said to access rather than enumerate drives
 * Page 81: The term &quot;Added&quot; is used in place of &quot;Created, Deleted&quot;
 * Page 83: Drive referred to in place of folder
 * Page 83: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
 * Page 84: Incorrect direction in step 6
 * Page 85: EnableRaisingEvents property referred to as EnablingRaisingEvents
 * Page 89, Incorrect namespaces used in stream types.
 * Page 91: Suggestion that files can be created when read
 * Page 92: Incorrect description of the functionality of the Directory class
 * Page 92: Description of OpenWrite method is incorrect
 * Page 97: &quot;read&quot; used in place of &quot;write&quot;
 * Page 100, Incorrect basic functionality description of StreamWriter class
 * Page 104: Incorrect description of the behavior of the sample code
 * Page 111: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
 * Page 111: Incorrect instruction in step 3 of Excercise 1
 * Page 112: Class referred to in place of object
 * Page 115: The descriptions of the CanRead property is incorrect
 * Page 120: CompressionMode.Compress used in place of CompressionMode.Decompress
 * Page 121: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
 * Pages 121 & 122: Code samples are incorrect for Step 7
 * Page 122, Step 9: Additional note needs to be added.
 * Page 127: Term &quot;file&quot; used in place of &quot;directory&quot;
 * Page 129: Incorrect definition for IsolatedStorageFileStream
 * Page 133: Files referenced in place of directories
 * Page 135: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
 * Page 135: Object referenced in place of class
 * Page 135: Incorrect Visual Basic code in step 3
 * Page 136: Incorrect Visual Basic code in steps 4 and 5
 * Page 137: Sample code missing
 * Page 139: Clarification of data in 4th bullet down under Chapter Summary
 * Page 140: Incorrect description of Case Scenarios
 * Page 141: Machine-level data referred to as assembly data
 * Page 165: IsZip method mentioned in place of ReformatPhone method
 * Page 170: &quot;E.&quot; should be removed from answer E
 * Page 187: &quot;or index&quot; should be removed
 * Page 188: Class referenced in place of collection
 * Page 192: Missing newline in code sample
 * 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 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 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 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 &quot;state abbreviations&quot; used in place of &quot;calling codes&quot;
 * Page 263: Incorrect text in Case Scenario 1, question 2
 * Pages 280, 281: &quot;XML&quot; used in place of &quot;SOAP&quot;
 * 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 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 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 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



CD-ROM: &quot;not&quot; should be removed from assessment question
In the Lesson Review on the CD-ROM, one of the questions is incorrect.

Change:

&quot;Which item is not generally considered a shortcoming associated with using COM Interop?&quot;

To:

&quot;Which item is generally considered a shortcoming associated with using COM Interop?&quot;

CD-ROM: Assessment answer should include ICollection and not IDictionaryEnumerator
In the Readiness Review assessment on the CDROM one of the questions reads:

&quot;You are creating a new collection type that must be iterated using for-each loop. Which of the following interfaces should you implement? (Choose all that apply)

ICollection

IDictionaryEnumerator

IDictionary

IEnumerable

IEqualityCOmparer&quot;

The assessment states that the answers are IDictionaryEnumerator and IEnumerator.

The correct answers are: ICollection and IEnumerator.

CD-ROM: Assessment answer should also include Resize event
In the Readiness Review Assessment, one of the questions reads:

&quot;Which of the following are events for the System.Windows.Forms.Button class? (Choose three)

Serializing

Enter

MouseHover

Resize

Click

MosueOver&quot;

The assessment states that the correct answers are: Enter, MouseHover, Click.

The assessment should also include the following answer as being correct: Resize.

CD-ROM: lesson3-exercise1-Person-partial code samples are missing from \Chapter01 folder
The Visual Basic and C# code samples &quot;lesson3-exercise1-Person-partial&quot; are missing from the \Code\Chapter01 folder. The folders and files are available for download from the Microsoft Download Center:

lesson3.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Page 3: System.Value referenced rather than System.ValueType
On page 3, the first sentence after the first bulleted list reads:

&quot;Each of these types is derived from the System.Value base type.&quot;

It should read:

&quot;Each of these types is derived from the System.ValueType base type.&quot;

Page 5: Date/date should be Date/none
On page 5, the first cell of the last row of Table 1-2 is incorrect.

Change:

&quot;System.DateTime (Date/date)&quot;

To:

&quot;System.DateTime (Date/none)&quot;

Page 5: 4 should be 1
On page 5, the Bytes column of the second row of Table 1-2 is incorrect.

Change:

&quot;4&quot;

To:

&quot;1&quot;

Page 9: NOTE is incorrect
On page 9, the NOTE reads:

&quot;NOTE .NET 2.0

The Operator keyword is new in .NET 2.0.&quot;

This is incorrect and the note should be disregarded.

Page 12: Term &quot;defines&quot; used in place of &quot;initializes&quot; in step 4
On page 12, the first sentence of step 4 reads:

&quot;Create a constructor that defines all three member variables, as the following code demonstrates:&quot;

It should read:

&quot;Create a constructor that initializes all three member variables, as the following code demonstrates:&quot;

Page 14: Term &quot;class&quot; used in place of term &quot;structure&quot; in step 5
On page 14, the first sentence of step 5 reads:

&quot;Modify your Main code to properly construct an instance of the Person class, as the following code sample demonstrates:&quot;

It should read:

&quot;Modify your Main code to properly construct an instance of the Person structure, as the following code sample demonstrates:&quot;

Page 18: The word &quot;variable&quot; is missing from the final sentence
On page 18, the last sentence on the page reads:

&quot;When you modify a reference type, you modify all copies of that reference type.&quot;

It should read:

&quot;When you modify a reference type variable, you modify all copies of that reference type variable.&quot;

Page 24: C# code sample missing
On page 24, the following code sample should be added directly below the VB code sample:

// C#

try {   StreamReader sr = new StreamReader(&quot;text.txt&quot;); Console.WriteLine(sr.ReadToEnd); }

catch (System.IO.FileNotFoundException ex) {   Console.WriteLine(&quot;The file could not be found.&quot;); }

catch (System.UnauthorizedAccessException ex) {   Console.WriteLine(&quot;You do not have sufficient permissions.&quot;); }

catch (Exception ex) {   Console.WriteLine(&quot;Error reading file: &quot; + ex.Message); }

Page 25: Incorrect code in C# example
On page 25, the first three lines of the VB code sample read:

Dim sr As StreamReader = New StreamReader(&quot;text.txt&quot;) Try Console.WriteLine(sr.ReadToEnd)

They should read:

Dim sr As StreamReader Try sr = New StreamReader(&quot;text.txt&quot;) Console.WriteLine(sr.ReadToEnd)&quot;

The first three lines of the C# code sample read:

&quot;StreamReader sr = new StreamReader(&quot;text.txt&quot;); try {   Console.WriteLine(sr.ReadToEnd);&quot;

They should read:

&quot;StreamReader sr; try {   sr = new StreamReader(&quot;text.txt&quot;); Console.WriteLine(sr.ReadToEnd);

Page 46: Correction in code example
On page 46, the C# code example under the third bullet point is incorrect.

Change:

// C# MyEventHandler handler = MyEvent;

EventArgs e = new EventArgs;

if (handler != null) {   // Invokes the delegates. handler(this, e); } // Note that C# checks to determine whether handler is null. // This is not necessary in Visual Basic

To:

// C# EventArgs e = new EventArgs;

if (MyEvent != null) {   // Invokes the delegates. MyEvent(this, e); } // Note that C# checks to determine whether handler is null. // This is not necessary in Visual Basic

Page 47: &quot;Guide&quot; used in place of &quot;Guid&quot;
On page 47, the first sentence of the second paragraph from the bottom contains an incorrect attribute.

Change:

&quot;Visual Studio automatically creates some standard attributes for your assembly when you create a project, including a title, description, company, guide, and version.&quot;

To:

&quot;Visual Studio automatically creates some standard attributes for your assembly when you create a project, including a title, description, company, guid, and version.&quot;

Page 51: Methods incorrectly named
On page 51, in step 4 the code samples read:

'VB Private Sub Form1_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) _'

and

//C# private void Timer_Shown(object sender, EventArgs e)

They should read:

'VB Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _'

and

//C# private void Form1_Load(object sender, EventArgs e)

Page 52: &quot;progressBar&quot; used in place of &quot;progressBar1&quot; in code sample
On page 52, a 1 needs to be added to &quot;progressBar&quot; in the first C# code sample at the top of the page.

Change: // C# void t_Tick(object sender, EventArgs e) { progressBar.Value += 10; if (progressBar.Value >= 100) t.Stop; }

To: // C# void t_Tick(object sender, EventArgs e) { progressBar1.Value += 10; if (progressBar1.Value >= 100) t.Stop; }

Page 55: Incorrect description of narrowing conversion behavior
On page 55, the sentence at the bottom of the page reads:

&quot;Narrowing conversions fail if the source value exceeds the destination type's range or if a conversion between the types is not defined, so you should enclose a narrowing conversion in Try blocks or use TryCast or TryParse and check the return value.&quot;

It should read:

&quot;Narrowing conversions may return an incorrect result if the source value exceeds the destination type's range. If a conversion between the types is not defined you will receive a compile-time error.&quot;

Page 58: Incorrect index used in the second code sample
On page 58, the last line of the second VB code sample reads:

Console.WriteLine(&quot;a = {0}, i = {0}&quot;, a.ToString, i.ToString)

It should read:

Console.WriteLine(&quot;a = {0}, i = {1}&quot;, a.ToString, i.ToString)

The last line of the C# code sample reads:

Console.WriteLine(&quot;a = {0}, i = {0}&quot;, a.ToString, i.ToString);

It should read:

Console.WriteLine(&quot;a = {0}, i = {1}&quot;, a.ToString, i.ToString);

Page 59: Decimal used in place of Double in code for Exercise 1
On page 59, in the third line of VB code in the second step of Exercise 1 reads:

Dim db As Decimal = 1

It should read:

Dim db As Double = 1

Page 63: &quot;narrowing&quot; used in place of &quot;widening&quot;
On page 63, the third sentence of the first paragraph reads:

&quot;C# allows implicit conversion for only narrowing conversions, where no information could be lost.&quot;

It should read:

&quot;C# allows implicit conversion for only widening conversions, where no information could be lost.&quot;

Page 72: &quot;Exist property&quot; referenced in place of &quot;Exists property&quot;
On page 72, the first sentence after the bulleted list reads:

&quot;For example, you can check whether a file exists by calling the FileInfo object’s Exist property, as shown in the following code:&quot;

It should read:

&quot;For example, you can check whether a file exists by calling the FileInfo object’s Exists property, as shown in the following code:&quot;

Page 73: string should be DirectoryInfo object
On page 73, the Description of Root in Table 2-5 is incorrect.

Change:

&quot;Gets the root part of the directory’s path as a string&quot;

To:

&quot;Gets the root part of the directory’s path as a DirectoryInfo object&quot;

Page 74: DriveInfo class described incorrectly
On page 74, the first sentence under the DriveInfo class section reads:

“The DriveInfo class provides the basic functionality to access and manipulate a single directory in the file system.”

It should read:

&quot;The DriveInfo class models a drive and provides methods and properties to query for drive information. Use DriveInfo to determine what drives are available, and what type of drives they are. You can also query to determine the capacity and available free space on the drive.&quot;

Page 76: Unknown member description is missing the word &quot;type&quot;
On page 76, the description of the Unknown member in Table 2-9 reads:

&quot;The drive could not be determined.&quot;

It should read:

&quot;The drive type could not be determined.&quot;

Page 76: Procedure said to access rather than enumerate drives
On page 76, the first sentence of the How to Enumerate Drives section reads:

&quot;You follow this procedure to access the drives in a system:&quot;

It should read:

&quot;You follow this procedure to enumerate all the drives in a system:&quot;

Page 81: The term &quot;Added&quot; is used in place of &quot;Created, Deleted&quot;
On page 81, the first sentence of the second paragraph reads:

&quot;In addition to using the Added and Changed events, you can monitor the system for renamed files.&quot;

It should read:

&quot;In addition to using the Created, Deleted and Changed events, you can monitor the system for renamed files.&quot;

Page 83: Drive referred to in place of folder
On page 83, the first sentence of Excercise 1 reads:

&quot;In this exercise, you will enumerate through all the files in a particular drive.&quot;

It should read:

&quot;In this exercise, you will enumerate through all the files in a particular folder.&quot;

Page 83: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
On page 83, step 2 reads:

&quot;Add an Import (or an include in C#) for the System.IO namespace into the new project.&quot;

It should read:

&quot;Add an Import (or aa using statement in C#) for the System.IO namespace into the new project.&quot;

Page 84: Incorrect direction in step 6
On page 84, the first sentence of step 6 reads:

&quot;In the Main method, write code to create a new instance of a DirectoryInfo object for the Windows directory and use it to call the new ShowDirectory method.&quot;

It should read:

&quot;In the Main method, write code to create a new instance of a DirectoryInfo class for the System directory and use it to call the new ShowDirectory method.&quot;

Page 85: EnableRaisingEvents property referred to as EnablingRaisingEvents
On page 85, step 7 reads:

&quot;Set the EnablingRaisingEvents property to true to tell the watcher object to start throwing events.&quot;

It should read:

&quot;Set the EnableRaisingEvents property to true to tell the watcher object to start throwing events.&quot;

Page 89, Incorrect namespaces used in stream types.
On page 89, the 3rd, 4th and 5th bullet points read:

&quot;* CryptoStream (System.Security)


 * NetworkStream (System.Net)


 * GZipStream (System.Compression)&quot;

They should read:

&quot;* CryptoStream (System.Security.Cryptography)


 * NetworkStream (System.Net.Sockets)


 * GZipStream (System.IO.Compression)&quot;

Page 91: Suggestion that files can be created when read
On page 91, the first bullet point reads:

&quot;Operations to create or open files for reading&quot;

It should read:

&quot;Operations to open files for reading&quot;

Page 92: Incorrect description of the functionality of the Directory class
On page 92, the second sentence of the Directory Class section reads:

&quot;The Directory class provides the basic functionality to open file streams for reading and writing.&quot;

It should read:

&quot;The Directory class provides the basic functionality to create, manage, delete, and analyze directories.&quot;

Page 92: Description of OpenWrite method is incorrect
On page 92, the Description for the OpenWrite method reads:

&quot;Opens an existing file for writing and returns a StreamWriter object.&quot;

It should read:

&quot;Opens an existing file for writing and returns a FileStream object.&quot;

Page 97: &quot;read&quot; used in place of &quot;write&quot;
On page 97, the first sentence of the first paragraph reads:

&quot;The StreamReader class provides the basic functionality to write data from a Stream derived class.&quot;

It should read:

&quot;The StreamReader class provides the basic functionality to read data from a Stream derived class.&quot;

Page 100, Incorrect basic functionality description of StreamWriter class
On page 100, the first sentence of the first paragraph reads:

&quot;The StreamWriter class provides the basic functionality to read data from a Stream derived class.&quot;

It should read:

&quot;The StreamWriter class provides the basic functionality to write data from a Stream derived class.&quot;

Page 104: Incorrect description of the behavior of the sample code
On page 104, the last sentence on the page reads:

&quot;For example, the following code will read the code just shown:&quot;

It should read:

&quot;For example, the following code will read the data written by the code just shown:&quot;

Page 111: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
On page 111, step 2 reads:

&quot;Add an Import (or an include in C#) for the System.IO namespace into the new project.&quot;

It should read:

&quot;Add an Import (or aa using statement in C#) for the System.IO namespace into the new project.&quot;

Page 111: Incorrect instruction in step 3 of Excercise 1
On page 111, step 3 of Exercise 1 reads:

&quot;In the Main method, create a new StreamWriter from the Create method of the File class.&quot;

It should read:

&quot;In the Main method, create a new StreamWriter by calling the CreateText method of the File class.&quot;

Page 112: Class referred to in place of object
On page 112, step 2 of Exercise 2 reads:

&quot;In the Main method after the StreamWriter class is closed, open the file using the OpenText method of the File class to create a new StreamReader object.&quot;

It should read:

&quot;In the Main method after the StreamWriter object is closed, open the file using the OpenText method of the File class to create a new StreamReader object.&quot;

Page 115: The descriptions of the CanRead property is incorrect
On page 115, the description of the CanRead property in Table 2-30 reads:

&quot;Determines whether the stream supports reading while decompressing a file. (Inherited from the Stream class.)&quot;

It should read:

&quot;Determines whether the stream supports reading. (Inherited from the Stream class.)&quot;

Page 120: CompressionMode.Compress used in place of CompressionMode.Decompress
On page 120, the first full code sample read:

' VB Dim compStream As _ New GZipStream(sourceFile, CompressionMode.Compress) // C# GZipStream compStream = new GZipStream(sourceFile, CompressionMode.Compress);

It should read:

' VB Dim compStream As _ New GZipStream(sourceFile, CompressionMode.Decompress)

// C# GZipStream compStream = new GZipStream(sourceFile, CompressionMode.Decompress);

Page 121: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
On page 121, step 2 reads:

&quot;Add an Import (or an include in C#) for the System.IO namespace into the new project.&quot;

It should read:

&quot;Add an Import (or aa using statement in C#) for the System.IO namespace into the new project.&quot;

Pages 121 & 122: Code samples are incorrect for Step 7
On pages 121 & 122, Exercise 1, Step 7, the VB and C# code samples are incorrect. When used in the exercise, they do not create a smaller compressed file.

Change: ' VB Dim theByte As Integer = sourceFile.ReadByte While theByte <> -1 compStream.WriteByte(CType(theByte, Byte)) theByte = sourceFile.ReadByte End While

// C# int theByte = sourceFile.ReadByte; while (theByte != -1) {   compStream.WriteByte((byte)theByte); theByte = sourceFile.ReadByte; }

To: ' VB Dim buffer(sourceFile.Length) As Byte sourceFile.Read(buffer, 0, buffer.Length) compStream.Write(buffer, 0, buffer.Length)

// C# const int buf_size = 4096; byte[] buffer = new byte[buf_size]; int bytes_read = 0; do {   bytes_read = sourceFile.Read(buffer,0,buf_size); compStream.Write(buffer,0,bytes_read); } while (bytes_read != 0);

Page 122: Additional note needs to be added for step 9.
On Page 122, Step 9 an addition NOTE needs to be added before the code sample for more information:

&quot;NOTE: Using a small file may result in the compressed file being larger than the original because of the overhead of compression. If you use a larger file, the size of the overhead will not cause such a pallor on the size of the resulting file.&quot;

Page 127: Term &quot;file&quot; used in place of &quot;directory&quot;
On page 127, the description of GetDirectoryNames in Table 2-36 reads:

&quot;Gets a list of directory names within the store that match a file mask&quot;

It should read:

&quot;Gets a list of directory names within the store that match a directory mask&quot;

Page 129: Incorrect definition for IsolatedStorageFileStream
On page 129, the first sentence of the first paragraph reads:

&quot;The IsolatedStorageFileStream class encapsulates a stream that is used to create files in isolated storage.&quot;

It should read:

&quot;The IsolatedStorageFileStream class encapsulates a stream that is used to read, write and create files in isolated storage.&quot;

Page 133: Files referenced in place of directories
On page 133, the paragraph before the final code sample reads:

&quot;Directories are treated much like files in that to test for their existence, you must use a method that returns an array of strings that match a file mask. The GetDirectoryNames method of the IsolatedStorageFile class allows you to find an existing file before you try to create it:&quot;

It should read:

&quot;Directories are treated much like files in that to test for their existence, you must use a method that returns an array of strings that match a mask. The GetDirectoryNames method of the IsolatedStorageFile class allows you to find an existing directory before you try to create it:&quot;

Page 135: The term &quot;include&quot; used in place of &quot;using&quot; in Step 2
On page 135, step 2 reads:

&quot;Add an Import (or an include in C#) for the System.IO namespace into the new project.&quot;

It should read:

&quot;Add an Import (or aa using statement in C#) for the System.IO namespace into the new project.&quot;

Page 135: Object referenced in place of class
On page 135, the first sentence of step 3 in Exercise 1 reads:

&quot;In the Main method of the new project, create a new instance of the IsolatedStorageFile object named userStore that is scoped to the current user and assembly.&quot;

It should read:

&quot;In the Main method of the new project, create a new instance of the IsolatedStorageFile class named userStore that is scoped to the current user and assembly.&quot;

Page 135: Incorrect Visual Basic code in step 3
On page 135, the Visual Basic code in step 3 reads:

' VB IsolatedStorageFile userStore = _ IsolatedStorageFile.GetUserStoreForAssembly

It should read:

' VB Dim userStore as IsolatedStorageFile = _ IsolatedStorageFile.GetUserStoreForAssembly

Page 136: Incorrect Visual Basic code in steps 4 and 5
On page 136, the Visual Basic code in step 4 reads:

' VB IsolatedStorageFileStream userStream = new _ IsolatedStorageFileStream(&quot;UserSettings.set&quot;, _                              FileMode.Create, _                                userStore)

It should read:

' VB Dim userStream as IsolatedStorageFileStream = new _ IsolatedStorageFileStream(&quot;UserSettings.set&quot;, _                             FileMode.Create, _                               userStore)

The code in step 5 reads:

' VB StreamWriter userWriter = new StreamWriter(userStream) userWriter.WriteLine(&quot;User Prefs&quot;) userWriter.Close

It should read:

' VB Dim userWriter as new StreamWriter(userStream) userWriter.WriteLine(&quot;User Prefs&quot;) userWriter.Close

Page 137: Sample code missing
On page 137, the fifth line of the first section of sample code reads:

// ...

It should read:

Console.WriteLine(&quot;No data saved for this user.&quot;);

Page 139: Clarification of data in 4th bullet down under Chapter Summary
On page 139, fourth bullet down under Chapter Summary it reads:

&quot;The StreamReader and StreamWriter classes are instrumental in dealing with moving data into and out of streams, including FileStreams, MemoryStreams, and IsolatedStorageFileStreams.&quot;

It should read:

&quot;The StreamReader and StreamWriter classes are instrumental in dealing with moving textoriented data into and out of streams, including FileStreams, MemoryStreams, and IsolatedStorageFileStreams.&quot;

Page 140: Incorrect description of Case Scenarios
On page 140, the first sentence of the Case Scenarios section reads:

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

It should read:

&quot;In the following case scenarios, you will apply what you’ve learned about files and directories.&quot;

Page 141: Machine-level data referred to as assembly data
On page 141, the Create a Simple Configuration Storage section reads:

&quot;For this task, you should complete at least Practices 1 and 2. To understand how user and assembly data differ in isolated storage, complete Practice 3 as well.

- Practice 1 Create a Windows Forms application that allows users to save data and store it in isolated storage.

- Practice 2 Test the Windows Forms application by running it under different user accounts.

- Practice 3 Modify the application to store some assembly-level data to see whether that data is the same for all users.&quot;

It should read:

&quot;For this task, you should complete at least Practices 1 and 2. To understand how user and machine-level data differ in isolated storage, complete Practice 3 as well.

- Practice 1 Create a Windows Forms application that allows users to save data and store it in isolated storage.

- Practice 2 Test the Windows Forms application by running it under different user accounts.

- Practice 3 Modify the application to store some machine-level data to see whether that data is the same for all users.&quot;

Page 165: IsZip method mentioned in place of ReformatPhone method
On page 165, the last sentence before the code sample in step 3 of Exercise 2 reads:

&quot;Though many different regular expressions would work, the IsZip method you write could look like this:&quot;

It should read:

&quot;Though many different regular expressions would work, the ReformatPhone method you write could look like this:&quot;

Page 170: &quot;E.&quot; should be removed from answer E
On page 170, Question 4, Answer E reads:

&quot;E. amomomottohez&quot;

It should read:

&quot;amomomottohez&quot;

Page 187: &quot;or index&quot; should be removed
On page 187, there are errors in the descriptions of Hashtable and StringDictionary.

Change:

&quot;Hashtable A collection of name/value pairs of objects that allows retrieval by name or index&quot;

To:

&quot;Hashtable A collection of name/value pairs of objects that allows retrieval by name&quot;

Change:

&quot;StringDictionary A collection of name/values pairs of strings that allows retrieval by name or index&quot;

To:

&quot;StringDictionary A collection of name/values pairs of strings that allows retrieval by name&quot;

Page 188: Class referenced in place of collection
On page 188, the second sentence of the Adding and Removing Items section reads:

&quot;Adding items to and removing items from the class is very straightforward.&quot;

It should read:

&quot;Adding items to and removing items from the collection is very straightforward.&quot;

Page 192: Missing newline in code sample
On page 192, the seventh line of the second code sample reads:

// C# IEnumerator enumerator = coll.GetEnumerator;

It should read:

// C# IEnumerator enumerator = coll.GetEnumerator;

Page 200: Answer B to question 2 is imprecise
On page 200, answer B reads:

&quot;To test whether two objects are the same reference of an object&quot;

It should read:

&quot;To test whether two variables are referencing the same object&quot;

Page 204: Description of code sample is incorrect
On page 204, the last sentence before the first code sample reads:

&quot;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:&quot;

It should read:

&quot;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:&quot;

Page 209: DictionaryEntry referred to as DictionaryEntries
On page 209, the fourth bullet point reads:

&quot;Enumerate dictionaries and know how to use DictionaryEntries.&quot;

It should read:

&quot;Enumerate dictionaries and know how to use DictionaryEntry.&quot;

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[&quot;sbishop@contoso.com&quot;])

It should read:

' VB Console.WriteLine(emailLookup(&quot;sbishop@contoso.com&quot;))

Page 213: Incorrect method used for supporting class
On page 213, in the fourth sentence of the first paragraph under &quot;Understanding Equality&quot; reads:

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

It should read:

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

Page 213: Values property referred to as the Value property
On page 213, the last sentence reads:

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

It should read:

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

Page 216: Incorrect description of Hashtable functionality
On page 216, the second sentence on the page reads:

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

It should read:

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

Page 216: Interfaces referred to as classes
On page 216, the first two sentences of the second paragraph read:

&quot;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.&quot;

They should read:

&quot;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.&quot;

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:

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

It should read:

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

The first sentence of step 4 of the section reads:

&quot;Repeat steps 1 through 3 until you have four bit masks.&quot;

It should read:

&quot;Repeat steps 1 through 3 until you have three bit masks.&quot;

Page 230: Bits referred to as bytes
On page 230, the eighth sentence of the second paragraph in the Understanding Binary Math section reads:

&quot;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.&quot;

It should read:

&quot;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.&quot;

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:

&quot;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.&quot;

To:

&quot;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.&quot;

Page 232: 98314 should be 196634 and 00000000000000011000000000001010 should be 00000000000000110000000000011010
On page 232, the value of the BitVector32 variable is incorrect.

Change:

&quot; ' 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.&quot;

To:

&quot; ' 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.&quot;

Page 234: CollectionsUtil referred to as CollectionUtil
On page 234, the third sentence of the Case-Insensitive Collections section reads:

&quot;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.&quot;

It should read:

&quot;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.&quot;

Page 235: CollectionsUtil referred to as CollectionUtil
On page 235, the sixth sentence of the second paragraph reads:

&quot;Unlike case-insensitive collections, CollectionUtil methods cannot be used to create your collections.&quot;

It should read:

&quot;Unlike case-insensitive collections, CollectionsUtil methods cannot be used to create your collections.&quot;

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 238: Incorrect usage of ListCollection class name in Step 3
On page 238, Step 3 reads:

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

It should read:

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

Page 239: CollectionsUtil referred to as CollectionUtil
On page 239, the third bullet point reads:

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

It should read:

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

Page 246: KeyValuePair referred to as NameValuePair
On page 246, the last entry on the page in Table 4-20 reads:

&quot;DictionaryEntry NameValuePair<>&quot;

It should read:

&quot;DictionaryEntry KeyValuePair<>&quot;

Page 249: Class referred to as object
On page 249, the sentence after the first code sample reads:

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

It should read:

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

Page 250: Dictionary referred to as a Queue
On page 250, the fourth sentence of the Generic Dictionary Class section reads:

&quot;To use a generic Queue type, you can follow these steps:&quot;

It should read:

&quot;To use a generic Dictionary type, you can follow these steps:&quot;

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) = &quot;Three&quot; dict(4) = &quot;Four&quot; dict(1) = &quot;One&quot; dict(2) = &quot;Two&quot; Dim str as String = dict(3)

It should read:

Dim dict = New Dictionary(Of Integer, String) dict(3) = &quot;Three&quot; dict(4) = &quot;Four&quot; dict(1) = &quot;One&quot; dict(2) = &quot;Two&quot; 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:

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

It should read:

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

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:

&quot;Unlike the CollectionBase and ReadOnlyCollection base classes, the DictionaryBase implements the IDictionary, IEnumerable, and ICollection interfaces.&quot;

It should read:

&quot;Unlike the CollectionBase and ReadOnlyCollectionBase classes, the DictionaryBase implements the IDictionary, IEnumerable, and ICollection interfaces.&quot;

Page 259: The term &quot;state abbreviations&quot; used in place of &quot;calling codes&quot;
On page 259, the first sentence in Exercise 1 reads:

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

It should read:

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

Pages 280, 281: &quot;XML&quot; used in place of &quot;SOAP&quot;
On pages 280 and 281, the title of Table 5-1 reads:

&quot;XML Serialization Attributes&quot;

It should read:

&quot;SOAP Serialization Attributes&quot;

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

Change:

&quot;A. An instance of BinaryFormatter&quot;

To:

&quot;A. An instance of BinaryFormatter or SoapFormatter&quot;

Page 287: serialized used in place of deserialized
On page 287, Question 4 reads:

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

It should read:

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

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:

  100 10.25  20.50 

It should read:

  100 10.25  20.50   2 

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:

&quot;B. XMLType

C. XMLElement

D. XMLAttribute&quot;

To:

&quot;B. XmlType

C. XmlElement

D. XmlAttribute&quot;

In the answers to question 4, change:

&quot;A. XMLType

B. XMLIgnore

C. XMLElement

D. XMLAttribute&quot;

To:

&quot;A. XmlType

B. XmlIgnore

C. XmlElement

D. XmlAttribute&quot;

Page 305: OnDeserialized should be OnDeserializing
On page 305, the last sentence references OnDeserialized instead of OnDeserializing.

Change:

&quot;Apply the OnDeserialized attribute to the method that should run during this event.&quot;

To:

&quot;Apply the OnDeserializing attribute to the method that should run during this event.&quot;

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

Change:

&quot;Apply the OnDeserializing attribute to the method that should run during this event.&quot;

To:

&quot;Apply the OnDeserialized attribute to the method that should run during this event.&quot;

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

Change:

&quot;Dim B As Bitmap = Image.FromFile(&quot;C:\windows\gone fishing.bmp&quot;)&quot;

To:

&quot;Dim B As Bitmap = New Bitmap(&quot;C:\windows\gone fishing.bmp&quot;)&quot;

Page 370: ThreadState.WaitJoinSleep referenced in place of ThreadState.WaitSleepJoin
On page 370, the description of Interrupt in Table 7-2 reads:

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

It should read:

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

Page 373: Thread referenced in place of value
On page 373, the last sentence of the first paragraph reads:

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

It should read:

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

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:

&quot;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 &quot;In Thread&quot; and shows the ManagedThreadId Property.&quot;

It should read:

&quot;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 &quot;Thread #&quot; and shows the ManagedThreadId Property.&quot;

Page 377: ThreadStart delegate referenced as StartThread
On page 377, the first three sentences of the Passing Data to Threads section read:

&quot;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.&quot;

They should read:

&quot;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.&quot;

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(&quot;Parameter for thread must be a string&quot;); }

It should read:

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

Page 380: Domain referenced in place of state
On page 380, the first sentence on the page reads:

&quot;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.&quot;

It should read:

&quot;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.&quot;

Page 383: Include statement referenced in place of using statement
On page 383, step 3 reads:

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

It should read:

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

Page 383: StartThread referenced in place of ThreadStart
On page 383, step 7 reads:

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

It should read:

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

Page 387: Interlock class referenced in place of Interlocked class
On page 387, the first bullet point reads:

&quot;Use the Interlock class to perform atomic operations.&quot;

It should read:

&quot;Use the Interlocked class to perform atomic operations.&quot;

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:

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

It should read:

&quot;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.&quot;

Page 390: AddCount method referenced in place of UpdateCount method
On page 390, the first sentence after Table 7-7 reads:

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

It should read:

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

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 407: EventWaitHandles referenced in place of EventWaitHandle
On page 407, the third sentence of the final paragraph reads:

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

It should read:

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

Page 410: Interlock class referenced in place of Interlocked class
On page 410, the first bullet point reads:

&quot;To perform atomic math operations, use the Interlock class.&quot;

It should read:

&quot;To perform atomic math operations, use the Interlocked class.&quot;

Page 414: Bytes written referenced in place of bytes read
On page 414, the first sentence of the first paragraph reads:

&quot;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.&quot;

It should read:

&quot;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.&quot;

The first sentence following the second code sample reads:

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

It should read:

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

Page 419: Event referenced in place of class
On page 419, the third sentence in the Windows Forms Application Exception Handling box reads:

&quot;You do this by registering for the ThreadException event on the Application event.&quot;

It should read:

&quot;You do this by registering for the ThreadException event on the Application class.&quot;

Page 421: QueueWorkItem referenced in place of QueueUserWorkItem
On page 421, the first sentence on the page reads:

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

It should read:

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

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,&quot;ThreadPooled&quot;) Then   Console.WriteLine(&quot;Could not queue item&quot;) End If

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

It should read:

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

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

Page 424: RegisterWaitHandle referenced in place of RegisterWaitForSingleObject
On page 424, the third sentence of the ThreadPool and WaitHandle section reads:

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

It should read:

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

Page 429: Thread execution behavior misrepresented
On page 429, the last sentence of step 8 reads:

&quot;Note that some of the work items are executed on different threads.&quot;

It should read:

&quot;Note that some of the work items may be executed on different threads.&quot;

Page 432: Case scenario topics misrepresented
On page 432, the first sentence of the Case Scenario section reads:

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

It should read:

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

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:

&quot;If 10 people visit an ASP.NET Web site simultaneously, ASP.NET will create a separate application domain for each user.&quot;

To:

&quot;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.&quot;

Page 456: Answer D of Question 3 partially incorrect
On page 456, Answer D of Question 3 reads:

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

It should read:

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

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

&quot;ConfigurationManager Properties and Methods&quot;

It should read:

&quot;Configuration Properties and Methods&quot;

Page 483: Configuration should be ConfigurationManager
On page 483, the title of Table 9-2 is incorrect.

Change:

&quot;Table 9-2 Configuration Properties and Methods&quot;

To:

&quot;Table 9-2 ConfigurationManager Properties and Methods&quot;

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(&quot;Item: {0} Value: {1}&quot;, _   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(&quot;Item: {0} Value: {1}&quot;, 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(&quot;Item: {0} Value: {1}&quot;, _   SettingsEnumerator.Current, AllAppSettings(SettingsEnumerator.Current)) End While

// C# NameValueCollection AllAppSettings = ConfigurationManager.AppSettings; IEnumerator SettingsEnumerator = AllAppSettings.Keys.GetEnumerator; while (SettingsEnumerator.MoveNext) {   Console.WriteLine(&quot;Item: {0}  Value: {1}&quot;, 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.

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

Keywords: KB923018

-

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

© Microsoft Corporation. All rights reserved.