Programming C# 5.0

Errata for Programming C# 5.0

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page #
Previous errata

My errata for april 5 were all of chapter 1, my errata of april 12 is for chapter 2

Wout Konradt  Apr 12, 2012 
Other Digital Version #

Missing line in the beginning of the example 15-20.

The text says:"Example 15-20 shows a version of the relevant code from Example 15-19 modified to work this way/"

Type pluginAttributeType = Assembly.ReflectionOnlyLoad(typeof(PluginInformationAttribute).Assembly.FullName).GetType("CustomAttributes.PluginInformationAttribute");

Without this line there is no comprehensible way to combine example 15-19 and (incomplete!) example 15-20 to get working code. I was able to recover this missing line only from the downloaded examples.

In other way, the example 15-20 should include the whole initial fragment of code as follows:
static void ShowPluginInformation(string pluginFolder)
var dir = new DirectoryInfo(pluginFolder);
Type pluginAttributeType = Assembly.ReflectionOnlyLoad(typeof(PluginInformationAttribute).Assembly.FullName).GetType("CustomAttributes.PluginInformationAttribute");
foreach (var file in dir.GetFiles("*.exe"))
Assembly pluginAssembly = Assembly.ReflectionOnlyLoadFrom(file.FullName);

Yuri Shirman  Nov 27, 2012 
PDF Page 8
1st paragraph

"However, they try have always tried hard"..

Double use of the verb 'try', I assume the first use could be removed.

wout Konradt  Apr 05, 2012 
PDF Page 11
"green block" sidebar?

My guess here is the word assuming is used, where the word assume should be used, the sentence doesn't sound correct otherwise.

"but does not assuming any prior experience in C#."

Wout Konradt  Apr 05, 2012 
PDF Page 11
Bottom of the page

"And the division's left-hand operand is another.."

I assume the left-hand side should be the right-hand side of the division.

Wout Konradt  Apr 12, 2012 
PDF Page 16
paragraph 2 (under example 1-2)

"because that's where the only code in in this example will live."

The word 'in' is double, and needs to be only there once.

Wout Konradt  Apr 05, 2012 
PDF Page 20
last sentence of the page

".. Example 1-8 would be not need either explicit .."

.. would not need ..
There is no need for 'be' in the sentence.

Wout Konradt  Apr 05, 2012 
PDF Page 36-37
Case statement discussion

In discussion of the case statements there is mention of multiple cases being allowed but the code example doesn't show it.
"As you can see, a single section can serve multiple possibilities ? you can put several different case lines at the start of a section, and the statements in that section will run if any of those cases apply"

Since the example does not show this, it could be misconstrued to mean the code statements in a singlecase further confused by the discussion of fall through. Code follows to illustrate missing example:

case 1: case 2: case 3: DoSomething(); break;
case 0: DoSomethingElse(); GoNutz(); break;

Jon Smith  Aug 01, 2012 
PDF Page 38
2nd paragraph

The expression has no subtraction, yet the explanation says the division is done before or after subtraction.

"..the division is performed or after the subtraction."

Wout Konradt  Apr 14, 2012 
PDF Page 39
Example 2-23 and 2-24

The difference between commented, and not commented text is unclear in the green lines of the examples.

Wout Konradt  Apr 14, 2012 
PDF Page 42
Example 2-29

"intt x;" should be int x;

Wout Konradt  Apr 14, 2012 
Printed Page 49
first paragraph

On topic of ConditionalAttribute text reads "You can annotate any method with this attribute" This is wrong. You can only annoate methods that return void and have no out parameters.

Peter Partch  Nov 11, 2012 
PDF Page 50
between Example 2-35 and 2-36

"Checked statements always involved a block.."

involved should be involve

Wout Konradt  Apr 14, 2012 
PDF Page 51
1st paragraph

"..arithmetic on integers is not a liming factor,.."

it is not a limiting factor? Or does liming mean the same?

Wout Konradt  Apr 14, 2012 
PDF Page 52
1st paragraph

In "integers is not a liming factor, so it?s quite possible that you won?t notice.", liming should be limiting

tatworth  Aug 28, 2012 
Printed Page 64
United States

"The shift operators move all the binary digits left or right by one position."

No, they move all the binary digits left or right by the number of bits specified by the 2nd operand.

Anonymous  Aug 15, 2014 
Printed Page 105
3rd paragraph

"In Example 3-20, fields a and b both have the same initializer..."
should be:
"In Example 3-20, fields a and c both have the same initializer..."

Patrick Skoe  Dec 11, 2012 
Printed Page 137
5th paragraph

should be

and also
P.170 1st paragraph

P.854 index
"System.Collections.Generics namespace, 138,170"
should be
"System.Collections.Generic namespace, 137,170"

Anonymous  Mar 20, 2014 
Printed Page 150
Paragraph 2

"with more than 2,147,483,591 (0x7FEFFFFF) elements"

2,147,483,591 is 0x7FFFFFC7. 0x7FEFFFFF is 2,146,435,071. But I think that what's really meant is

"with more than 2,147,483,647 (0x7FFFFFFF) elements"

Tim LaBerge  Jan 09, 2013 
Printed, PDF Page 406
Example 11-10

No such method as CreateAsync in the System.Reactive.Linq.Observable class

Max  Jul 15, 2013 
Printed Page 518
2nd paragraph

Though DynamicAttribute is not needed for the local variable(because the only code that can use a local variable is its defining method), Why is DynamicAttribute need for parameters?

Anonymous  May 09, 2014 
Printed Page 519
3rd paragraph

Restrictions on the dynamic Type

"C# compiler is doing work at runtime to determine how to perform that addition."


"C# compiler is doing work to determine at runtime how to perform that addition."

Anonymous  May 10, 2014 
PDF Page 523
1st paragraph (inside warning icon)

Both two references to Example 14-17 should be to Example 14-16. Example 14-17 is for ExpandoObject.

Yoshiharu Dewa  Jul 01, 2013 
PDF Page 532
1st paragraph

The sentence,

"This is the version number end users will see if....."

should be

"This is the version number and users will see if....."

The "end" is typo.

Yoshiharu Dewa  Jul 01, 2013 
PDF Page 582
2nd paragraph

"Although the File and Folder classes"
should be
"Although the File and Directory classes"
because there's no Folder class in the .NET Framework class library.

Yukitoshi Suzuki  Feb 13, 2013 
PDF Page 625
Example 17-14

email.SendCompleted += (s, e) => { if (!tooLate) { emailSent.Set(); } }
should have a semicolon at the end of line:
email.SendCompleted += (s, e) => { if (!tooLate) { emailSent.Set(); } };

Yukitoshi Suzuki  Apr 09, 2013 
Printed Page 625
Example 17-14.

"// Prevent call to Set after a timeout"

it does not prevent completely to call Set at timeout.

should be

"// Prevent call to Set after emailSent has been disposed."

Anonymous  May 18, 2014 
PDF Page 626
In "WaitHandle", line 3 and 6

should be

Line 6:
A ManualReset event
should be
A ManualResetEvent

Yukitoshi Suzuki  Apr 09, 2013 
PDF Page 674
4th line

In the last line, 'GetWaiter' should be 'GetAwaiter'.

Yukitoshi Suzuki  May 20, 2013 
PDF Page 683
2nd paragraph

4th line in the 2nd paragraph says:
WPF would interpret it as the Page class in the System.Windows.Controls.Page CLR namespace.
but I think its namespace should be 'System.Windows.Controls' because there's no 'System.Windows.Controls.Page' namespace.

Yukitoshi Suzuki  Jun 05, 2013 
PDF Page 708
2nd paragraph

The 1st line of 2nd paragraph says:
All elements define a LayoutChanged event.
but I think it should be:
All elements define a LayoutUpdated event.

Actually, there's no LayoutChanged event for for UIElement class, but LayoutUpdated.

Yukitoshi Suzuki  Jun 26, 2013