Errata

Microsoft® Silverlight® 4 Step by Step

Errata for Microsoft® Silverlight® 4 Step by Step

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
Printed, PDF Page 00
Deep zoom project chapter 5

Deep Zoom Project:

For some reason when you specify the Uri line in the main page function, it doesn't recognize "GeneratedImages/dzc_output.xml" as a valid path. After playing around for a bit, I was able to get it to work, my Uri line looks like this:

Uri uri = new Uri( "http://localhost:<port>/DeepZoomProjectSite/ClientBin/GeneratedImages/dzc_output.xml", UriKind.RelativeOrAbsolute );

<port> = what ever port your development server is using.

Also make sure that the web site project is the startup project.

Hope this helps.

John

John  Dec 30, 2010 
Printed, PDF Page 1
page 1 paragrapgh 1

The WebInstaller is upgraded to 3.0 on microsoft.com/web and it is less obvious which components to install!

Michiel  Jan 15, 2011 
Printed Page 2
Item #2

Microsoft no longer supports or distributes Web Platform Installer 2.0. Other software tools have also been re-issued in later, revised versions. Some of the "required" tools no longer exist--at least as Microsoft downloads.

The directions for downloading and installing the covered software are no longer current, active, or workable--rendering the "step-by-step" instructions throughout the book largely unusable.

In short, the publication is essentially obsolete within 6 months of its publication. I believe this could be remedied by publishing extensive revisions online, but I have been unable to find these at either Microsoft Press or O'Reilly Press.

Anonymous  Feb 01, 2011 
10.1.2
10.1.2 Step 3

using System.XML;

should be

using System.Xml;

Terry S  Jul 06, 2012 
PDF Page 38
The MouseWheel sample

The MouseWheel Event sample does not work (i.e wheel actions are not recognized) until you click onto anything that comprises Silverlight content.

This is tehnically normal as Silverlight control is not active at the start of the program (Silverlight control is just a part of its containing HTML page and does not have a focus by default unless something activates it), but the books does not say a bit about this so the reader is puzzled.

This behaviour can be prevented programmatically by including code in the HTML page that intentionally activates the Silverlight control at the start of life of the HTML page but that is out of the scope of this sample.

Gjuro  Apr 11, 2011 
Printed Page 78
Step #3

I have completed thru step (2). On step (3), the "Add New Domain Service Class" dialog box appears. The "Domain service class name:" lists FriendsService and the check box is checked for "enable client access." Under "Available DataContexts/ObjectContexts:" it is empty. No listing of "MyFriend" and it's check box.

The only deviation thru the book up to this point is: On page (73) I did not receive the dialog box "Choose Name." I did go to the proberties window and changed the name to "MyFriends" and I can't rember but I think I right clicked the file tab in the designer to save. Other than that, things were perfect up to step (3) page:78.

I am looking forward towards your assistance to get through this issue. Thank you very much.

David  Sep 18, 2010 
Printed Page 79
middle

On page 79 when you are stepping the reader through creating a domain service you need top add that the 'Enable Editing' checkbox should be checked. This creates (of course) the Insert, Update and Delete methods. If this is not done the instructions to change data and click the button (in step 14 on page 82) will fail.

Anonymous  Jun 28, 2010 
Printed Page 79
Create the Silverlight Client

On Step 5 it says to add some using's to the top of the MainPage.xaml.cs. Putting aside the fact that the first "Using" is indented and upper-cased (er?), why are we adding "using SbSCh4_1.Web;" without a reference to an assembly that has that namespace? And since we know that the assembly that has that namespace is the ASP.NET web project, how on earth are you supposed to reference that project if that is an ASP.NET assembly and you're working with a Silverlight assembly? (You cannot reference an ASP.NET web assembly in a Silverlight project. They are binary-incompatible.)

I don't think the author even tested this gobbligook.

Jon Davis  Oct 30, 2010 
Printed Page 79
Create the Silverlight Client

Following up on my other post, I figure out where the SbSCh4_1.Web namespace came from in the Silverlight project, i.e. in Step 5 of the initial client steps. The author failed to mention that you need to right-click on the project node in Solution Explorer and view the Project Properties. Then look for the "WCF RIA Services link" drop-down menu. It defaults to "<No project set>". Change it to SbSCh4_1.Web.

Jon Davis  Oct 30, 2010 
Printed Page 79
Item 3. set grid Name

I was difficult to find the location where I could change the Name property in 2 .. it was greyed out. Then in 3. I clicked on everything until clicking the []down arrow showed the AutoGenerateColumns property.

Cliff  Dec 29, 2010 
Printed, PDF Page 82
Step 14

The book in Step 14 on page 82 says: "the application will write the changed data to the database". However I have built this application from scratch, step by step, (several times!) and I always get the following exception:

System.NotSupportedException was unhandled by user code
Message=This EntitySet of type 'FinalAttemptCh4_1.Web.MyFriend' does not support the 'Edit' operation.
StackTrace:
at System.ServiceModel.DomainServices.Client.EntitySet.EnsureEditable(EntitySetOperations operation)
at System.ServiceModel.DomainServices.Client.Entity.RaiseDataMemberChanging(String propertyName)
at FinalAttemptCh4_1.Web.MyFriend.set_FirstName(String value)
InnerException:

It would seem that the default supported operations in the Domain Service differ from those that were available when the book was written.

How do we get it to support the Edit operation?

Ian W  Sep 14, 2010 
Printed Page 82
The project fails to compile

My experience with the Project in this Chapter 4 is the same as Ian W. has already noted. With the code I creating working through the exercise of this chapter, the build terminates with an error.

This also occurs when the first of the two versions of this same exercise (SbSCh4_1) from the CD is built, with 20 build errors

Oddly, there is another version of the same exercise on the CD labeled "SbSCh4_1_Revised". This also fails to build, and ends on this line:

loadOp = this._friendsContext.Load(this._friendsContext.GetMyFriendsQuery());

with an "ArgumentException was unhandled by user code."

The only explanation as to why this "Revised" version is provided that I've found is a note in the MainPage.xaml.cs page:

// Note that the book says to use System.Windows.Ria -- this was changed to the below line by MS post-writing the book. Sorry about that... :)

Obviously, there's been some problems with this project, but it seems there may be some others as well that haven't as yet been fixed.

Mr. Moroney, any chance you could indicate what is wrong here? I'm not a good enough Silverlight programmer to figure this out on my own, which is, of course, why I purchased your book.

Thanks for your help,

Ian J.

Ian Jaffray  Dec 06, 2010 
Printed Page 91
Step 1

Step 1 in Add links to your project on page 91 should be changed from:

"Return to the Compose tab. Find the Area tool on the Images pane and
select it to add a new area to the composition."

to

"Return to the Compose tab. Find the Hot Spot tool on the images pane and select it to add a new area to the composition."

Anonymous  Aug 05, 2010 
Printed Page 94
This entire project

Maybe it's me but ...

Trying to execute the "Program a Deep Zoom project" section in this book ...

I'm using Deep Zoom Composer Version 1.0.1945.1. I worked through Steps 1 to 5, opening the solution in Visual Web Developer Express 2010 and allowing the conversion.

Then I tried to run the app once I got to Step 8. No images displayed in the browser. Checked my code against the book, everything seems OK.

I continued on with the "Enable image interaction" section, Step 1 to the end of Step 6. Tried to run the app again. This time I am getting the buttons, but again there are no images being displayed. Something's not as advertised.

There is no finished code provided for this project, which would have been nice to have, even though we do supply our own images for the Composer. Why weren't a couple of images provided for this project on the CD so there could be functioning project code as well?

So, Mr. Moroney, any chance you can confirm if there's something inaccurate in your book, or if I have done something incorrect? I see a lot of "unconfirmed errata" here for this book but no "confirmed errata," so I'm wondering if anyone is taking an interest in this book since it's been published and once it's been purchased.

Here's a copy of the dzc_ouput.xml file in case you can tell anything from that. Everything else code-wise is as you've written it in the book, as far as I can see.

Thanks for your help,

Ian J.

----

<?xml version="1.0" encoding="utf-8" ?>
- <Collection MaxLevel="8" TileSize="256" Format="jpg" NextItemId="2" ServerFormat="Default" xmlns="http://schemas.microsoft.com/deepzoom/2009">
- <Items>
- <I Id="0" N="0" Source="dzc_output_images/chrysanthemum.xml">
<Size Width="1024" Height="768" />
<Viewport Width="2" X="-0" Y="-0" />
</I>
- <I Id="1" N="1" Source="dzc_output_images/desert.xml">
<Size Width="1024" Height="768" />
<Viewport Width="2" X="-1" Y="-0" />
</I>
</Items>
</Collection>

Ian Jaffray  Dec 06, 2010 
PDF Page 98
void btnIn_Click() procedure

the btnIn_Click() procedure contains the statement:

zoom *= 1.3;

I believe it should be:

zoom = 1.3;

Namely, the user is advised in the book to complete the complementary procedure btnOut_Click(), which would zoom out the picture, and the reasonable implementation would be, according to what is shown in the btnIn_Click() procedure:

zoom /= 1.3;

If a user implements procedure with *= and /= operators, it seems that zoom operator is 'lagging'. Namely, if you click btnIn three times (it zooms in as expected) and then click btnOut, it again zooms IN and not OUT (this happens because zoom factor at btnOut click is 1.3*1.3*1.3 and dividing it by 1.3 still gives a zoom factore larger than 1, which makes the program zoom in).

If procedures are implemented with the following statements:

zoom = 1.3;

and

zoom = 1 / 1.3;

everything works fine, btnIn click always zooms in and btnOut click always zooms out.

gjuro kladaric  Apr 19, 2011 
Printed Page 155
Step 9

At step 9, we are told that the application is still running in the browser and that in step 10 we can right-click to install the application on the desktop.

I'm seeing quite different behaviour - in my case, at step 9 I am already running outside the browser and there is no way to install the application. I can only launch it from within Visual Studio. I can right click to remove the application, but then launching from Visual Studio runs the app outside the browser again.

Everything seems to be the same. The only difference is that I'm using a full copy of Visual Studio 2010, rather than Visual Web Developer.

Why am I seeing this difference in behaviour?

GavinM  Jan 17, 2011 
Printed Page 158
Step 6

This comment builds on my previous comment - it's a continuation of the same difference in behaviour I'm observing.

At step 6, when I run the project I should see the application launch in the browser and the Install button should be visible.
However, in my case, the application launches as a stand-alone app immediately, not within the browser. So the Install button doesn't become visible in my case and I have no option to install the application.

Any ideas on the difference in behaviour?

GavinM  Jan 17, 2011 
Printed Page 191
Middle

I created the SbSCh9_1 project but I cannot get the buttons to display. I debugged for a long time then opened the code from the included CD. The sample code produced the same page WITHOUT the buttons. What am I (and the sample code) missing?

Wes Stephens  Feb 08, 2011 
Printed, PDF Page 213
Step 17

The clientaccesspolicy.xml file, explained on page 223, is required in order for the code to run successfully on my set-up (described below), on page 213 step 17, on page 215 step 20, and page 222, step 18. This file is also absent from the practice files provided on the accompanying CD.

Without this file, the code provided fails at the following code location:

SbSCh10_1.MainPage.wc_OpenReadCompleted

StreamReader read = new StreamReader(e.Result);

and SbSCH10_2 also fails at a location I did not determine.

A working listing for the clientaccesspolicy.xml file, to be added to the SbSCH10_1.Web and the SbSCH10_2.Web projects, is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path ="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>

Note that the Online Templates (Add New Item - Online Templates - Templates - Silverlight) includes a "Silverlight Client Access Policy File" template, that can be modified as above.

For background commentary, see:

http://timheuer.com/blog/archive/2008/04/06/silverlight-cross-domain-policy-file-snippet-intellisense.aspx

My platform for this exercise is Microsoft Visual Web Developer 2010 -Windows 7 64-bit running IE8. As instructed in the book, I used the Web Platform Installer to install the required supporting elements.

David Chennells, ObjectSharp Corporation (Toronto, Canada)  Aug 12, 2010 
Printed Page 242
Bullets 2-5

In Bullet 2

SupportedOrientations = ...

simply does not occur in the Mainpage() constructor in MainPainPage.xaml.cs. After a lot of hunting around, it appears in MainPage.xaml (and differently) as:

SupportedOrientations="Portrait" Orientation="Portrait"

As a result, all of subsequent bullets are wrong.

NOTE: It kills me that Microsoft's documentation is so fragmented (hence almost useless) that I had to BUY a book by a "Senior Technical Evangelist" and it too has such awful mistakes.

Anonymous  Sep 07, 2010 
Printed Page 242
2nd bullet

As noted by "Anonymous" there is a problem with the discussion of orientation on this page. However, it's a fairly small discrepancy.

Bear in mind that for simple tasks such as setting properties, anything that can be done with procedural code can also be done declaratively, and vice versa.

Sure, the MainPage constructor doesn't contain the line of code quoted - but the SupportedOrientations property does exist and you can set it in the constructor - so other than the fact that the template puts this definition in the XAML and not in the constructor, the discussion is correct.

You can alter it in code or in the XAML as you prefer.
I guess it's bad practice to have it in both locations - so either do it in code or do it in XAML.

Details like this can and do change. I've started my journey in early 2011 and there are many differences between the current software and that which was current when the book was written. No sweat.

GavinM  Feb 19, 2011 
Printed, PDF Page 246
2nd paragraph. code example

The code "OrientationChanging" is no longer available in final release of WP7.

Anonymous  Jan 21, 2011 
Printed, PDF Page 250
item 3 on page

Item Reference "Microsoft.Phone.Shell" is not available. XML code for Main Page already has commented our reference for Application Bar which and be used by removing comment marks and changing example code that was commented out.

Anonymous  Jan 21, 2011