Author response: Microsoft Visual C# 2013 Step by Step

As you might know, you can give us feedback anytime about our books via (We know you’re busy, so we’ve kept it short with just a few questions.) But because we don’t ask for personal information, we can’t respond personally to comments and questions that you leave us. So, in case the person who left us the following follows our blog, we want you to know that we sent your comment to the book’s author. First, your comment:

9780735681835          Microsoft Visual C# 2013 Step by Step                                                                                  

Very satisfied–Definitely would recommend

I can't get the EnumeratorTest exercise in chapter 19 to compile.

An explicit interface  IEnumerator<TItem> IEnumerable<TItem>.GetEnumerator() is generated in class Tree<TItem> which is private. It then cannot be accessed by the foreach() call in EnumeratorTest. This is the situation described earlier in chapter 13 with the 'number of legs' Horse example. You seem to contradict your own earlier lesson.

And here is author John Sharp’s response:.

I suspect that the reader has made a mistake somewhere in his/her code. The foreach statement in C# hides the complexity of using an enumerator, and as long as the collection being enumerated implements the IEnumerable interface explicity (i.e., it provides an explicit implementation of GetEnumerator), then the GetEnumerator method should not be public - indeed, it cannot be public because explicit interface implementation prohibits public methods as described in Chapter 13. The key thing is that the class being enumerated must be enumerable, and the compiler handles the rest when it generates the code for the foreach statement.



Hope that helps!

Comments (9)
  1. Steve G says:

    Please where can i download the code samples ? the link in the book does not work and i need these or the book is useless!

  2. Rick P says:

    Like Steve G, I'm trying to find where I can download the code samples.  The "download" link from is dead.  More specifically…  \…/C returns "File not found".

  3. Steve G says:

    Yes Rick many of us are waiting on this to be fixed. I can't find the zip file anywhere else online. I've emailed one of the MS help addresses hopefully they will fix it soon.

  4. Steve G and Rick P, we'll get this fixed ASAP. We're working on this with Pearson (who hosts our store site) now. I'll post another comment when the issue is fixed. Thanks for letting us know!

  5. KimSpilker says:

    This is fixed now.

  6. Suggestion says:

    If there's anyone still having trouble finding these files, here's a link:…/microsoft-visual-c-sharp-2013-step-by-step-9780735681835

    Just click on the Companion Content tab beneath the book sales links area, and follow the instructions there.

    1. Stephanie B says:

      There is no “companion content” tab in the Microsoft Store.

  7. ldjessup says:

    Does this book have anything to do with Excel 2016? If it does this book is worthless. Just starting and trying to follow the book and it is worthless. What a waste of $.

Comments are closed.

Skip to main content