Errata

Developing Microsoft SharePoint Applications Using Windows Azure

Errata for Developing Microsoft SharePoint Applications Using Windows Azure

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

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

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 37-38
the code snippet

The following lines appear in this sample:

string myAccountKey = "myliveID@hotmail.com";
string myUniqueUserId = "your key here";

....

azureWebRequest.Credentials = new NetworkCredential(myAccountKey, myUniqueUserId);

Obviously, the two variable names are reversed. The code works only because the author made the same reversal in the last line that he made in the first two lines. But that doesn't change the fact that this code is very misleading. The FIRST parameter to the NetworkCredential ctor must be a user name and the SECOND must be the DataMarket account key.

Note from the Author or Editor:
This is correct. Make sure the first variable is the user name and the second is the key.

Rick  Aug 13, 2011 
Printed
Page 42
step 7 at the bottom

The following phrase should be deleted from step 7:
"After the project has been created"
That phrase makes no sense here. The project is not only created, we've already added a service reference to it in an earlier step.

Note from the Author or Editor:
Typo: "project" was meant to be "service reference" here.

Rick  Aug 13, 2011 
Printed
Page 43
the code snippet

This code was apparently copied from p 36, but the namespace and class names are not correct here on p 43. The namespace is DallasCrimeDataWebPart and the class is ReturnCrimeData.

Note from the Author or Editor:
If you walk through the steps, then you will have a namespace of DallasCrimeDataWebPart (assuming you don't add your class as a separate resource in a separate namespace) and the class will read ReturnCrimeData. The important elements are the class members/properties are the same.

Rick  Aug 13, 2011 
Printed
Page 44 & 49
the "using" statements on both pages

Both of the these pages have the line:

using Dallas_Silverlight_Crime_App.DallasCrimeDataSvc;

But in fact in step 6 on p. 42, we were instructed to use the name DallasCrimeDataService. So the two using statements should be:

using Dallas_Silverlight_Crime_App.DallasCrimeDataService;

Rick  Aug 13, 2011 
Printed
Page 49-50
steps 5-7 on 49 and steps 9-11 on 50

This procedure has us add the service reference twice. Once in steps 5-7 and then again, with a different name, in steps 9-11. This is redundant. Steps 9-11 should be deleted.

Note from the Author or Editor:
This is indeed a duplicate step. You only need to add the local service reference once.

Rick  Aug 13, 2011 
Printed
Page 123
step 9

With SDK 1.4, a reference to Microsoft.WindowsAzure.StorageClient.DLL is already part of the project when it is created so it cannot be added here.

Rick  Aug 15, 2011 
Printed
Page 124
using statements in code snippet

You also have to add a using statement for Microsoft.WindowsAzure.ServiceRuntime

Rick  Aug 15, 2011 
Printed
Page 125
RowCommandHandler definition

The following line in the RowCommandHandler definition is unneeded:

var blobContainer = azureBlobClient.GetContainerReference("imagefiles");

There is already a global blob container reference that was initialized in the Page_Load method. Delete the line above and change the variable name in the line that follows it to azureBlobContainer like this:

var blog = azureBlobContainer.GetBlobReference(blobName.ToString());

Rick  Aug 15, 2011 
Printed
Page 126
last paragraph

"... the GetCurrentDateTime method (a helper method that returns the current date and time as a DateTime object) ... "

Actually, it returns the current date and time as a STRING object. In fact, converting the DateTime to a string is the only purpose it serves.

Rick  Aug 15, 2011 
Printed
Page 136
code sample, 3rd line from the bottom

"videofiles" near the end of the line should be "imagefiles"

Rick  Aug 18, 2011 
Printed
Page 136
step 2

"WCF Web Application" should be "WCF Service Application"

Rick  Aug 18, 2011 
Printed
Page 138
step 6

"the WCF solution" should be "the WCF project within your solution". You do NOT want to right-click the whole solution.

Rick  Aug 18, 2011 
Printed
Page 138
between step 4 and step 5

There is a missing step between steps 4 and 5. You have to open the *.svc file in Visual Studio and change the "Service1" to "GetAzrueDataStorage". Otherwise, IIS throws an exception that it can't find a type named "Service1".

Rick  Aug 18, 2011 
Printed
Page 138
step 9

This step is way too rushed and leaves out much. I recommend replacing it with the following:

9.a. After the IIS web site is created, double-click Application Pools in the IIS Manager navigation tree to open the list of application pools.

9.b. Look at the entry for the pool that has the same name as the IIS web site you just created. The .NET Framework column should say "v4.0" for this row. If it does not, right-click the row and select Basic Settings. In the dialog that opens, change the .NET Frameowrk to 4.0 and click OK.

9.c. Highlight the new IIS web site in the Sites node of IIS manager and click the Content View tab near the bottom of the screen.

9.d. Right-click the *.svc file and select Browse. If all is well, your browser will open to a page telling you that you need to create a client. You will NOT get the actual data from the service at this time.

Note from the Author or Editor:
While we're only testing if the service resolves and loads, this is fine detail to add.

Rick  Aug 18, 2011 
Printed
Page 138
step 8

Before you close the Add Web Site dialog, you need to click Test Settings to verify that your service user is both authenticated and authorized to read the folder to which you published the service. ON A TYPICAL SHAREPOINT DEVELOPMENT MACHINE, IT WILL NOT BE AUTHROIZED. If it is not, either give the user the needed sharing permissions to the folder or use the Connect As button on the Add Web Site dialog to change the service user to one who already has the needed permissions.

Note from the Author or Editor:
Yes, this is correct. Also, note that much of this book was written in an admin context on a single server farm and should be treated as demo code. This book warrants an entirely separate FAQ on best practices for production deployments.

Rick  Aug 18, 2011 
Printed
Page 138
step 12

Some text that is not bolded also needs to be added; for example, the "sdk" namespace declaration and the DesignerWidth. You really should replace all of the contents of MainPage.xaml with the whole of the code sample in this step.

Rick  Aug 18, 2011 
Printed
Page 139
step 13

replace "to the file" with "to the project"

Rick  Aug 18, 2011 
Printed
Page 139
between steps 13 and 14

There's a step missing here. Between steps 13 and 14, you need to add a reference in the project to the System.Xml.Linq assembly.

Rick  Aug 18, 2011 
Printed
Page 139
between steps 13 and 14

ANOTHER MISSING STEP BETWEEN STEPS 13 AND 14!

You have to right-click the References node in the project and add a Service Reference. Click Discover in the dialog and it will find the service you created earlier in the exercise. Click Go. Then replace the default namespace name with "AzureImageWCFService". Click OK.

Rick  Aug 18, 2011 
Printed
Page 139
between steps 13 and 14

A THIRD MISSING STEP between steps 13 and 14.

You have to right-click the References node in the Silverlight project and add a reference to the System.Windows.Controls.Data assembly. If you don't some generated code that references the DataGrid control will produce a compile time error.

Note from the Author or Editor:
On page 138, in step 12 the instructions discuss adding code that provides a datagrid on the app. You can also drag and drop a Datagrid control to the Silverlight canvas, which will automatically add the correct assembly references to the project.

Rick  Aug 18, 2011 
Printed
Page 140
after step 15

There's a missing step here after step 14. You need to add the two cross domain policy XML files from the top of p. 51 to the folder where you published the WCF service. E.g., C:\AzureBlobService

Rick  Aug 18, 2011 
Printed
Page 145
2nd kube

the line
using Microsoft.SharePoint.Client;
should be:
using ClientOM = Microsoft.SharePoint.Client;

Note from the Author or Editor:
On page 147, the code that leverages the clientside object model is prefaced with the "ClientOM" namespace. As per the errata suggestion, you can amend the using statement to "using ClientOM = Microsoft.SharePoint.Client" else leave "using Microsoft.SharePoint.Client" and remove the "ClientOM" namespace prefix in the code.

Rick  Aug 19, 2011 
Printed
Page 150
step 16

An additional required step is left out. You need to edit the Web Part to change its Height to 600px and its width to 1000px.

Note from the Author or Editor:
On page 150, after step 16, you can edit the web part and in the Appearances section of the Web Part Options you can select a Height and Width for the web part. As per the note, you can select 600px for height and 1000px for width--or whatever height and width are amenable to your needs.

Rick  Aug 19, 2011 
Printed
Page 150
after step 16

There is a whole set of missing steps here connected with creating a list. You have to create a list named "Azure Images" and give it a Link column (SharePoint column type hyperlink), a Coolness column (type Choice), and a Notes column (type multiple lines of test). To get your list to match the screen shot on p. 151, you also have to rename the Title column to "Name".

Note from the Author or Editor:
On page 150, step 9 assumes you've created a list called Azure Images. It should read:

9. Open your SharePoint site, and if you haven't already create a new list called "Azure Images" and add three columns. Call the first column you add (of type Hyperlink) "Link." Call the second column you add (of type Choice) Coolness. Call the third column you add (of type Multiple lines of text) Notes. Then rename the Title column to "Name."

Rick  Aug 19, 2011 
Printed
Page 153
N/A

The downloaded source files for chapter 6 are missing the WCF service folder and its files. The *.sln file is looking for WCFServiceWebRole1\AzureMortgageService.csproj and there isn't such a folder or file.

Note from the Author or Editor:
I've added the missing service code here: https://skydrive.live.com/redir.aspx?cid=40a717fc7fcd7e40&resid=40A717FC7FCD7E40!4149&parid=root. It is contained in the "Missing_Service_Code.zip" zipped archive.

Rick  Aug 21, 2011 
Printed
Page 156
step 9

"AzureService.cs" should be "AzureService.svc.cs"

Note from the Author or Editor:
When you create a new service, the default name is typically "Service1.svc" for example. When you double-click to view the service class code, you should see "Service1.svc.cs" as the class code. So, this errata is correct; there was an editing error that was not caught. If you follow the steps, in your project you should have "AzureService.svc.cs" as the core service class code.

Rick  Aug 21, 2011