Tuesday, August 24, 2010

Error on Azure Development Storage startup

Right after you install Azure Tools for Visual Studio, if you try to start the Development Storage service, a command prompt window pops up, then shows a error message in red, then closes so fast you can't even start to read the error message. I've tried to start the Development Storage from a command prompt to see what was the error. But the .lnk file to Dev Storage does not show what is the command to start it.
Tip 1: To start Azure Development Storage from a command prompt, open an Azure Command Prompt (Start > All Programs > Windows Azure SDK > Windows Azure SDK Command Prompt), and then run csrun /devstore.
Ok. Then I could see the error message:
Encountered an unexpected error from the devstore: Unable to start Development Storage.
Error Details: Failed to start Development Storage: the SQL Server instance 'localhost\SQLExpress' could not be found. Please configure the SQL Server instance for Development Storage using the 'DSInit' utility in the Windows Azure SDK.
Nothing like being able to read the error message when you're trying to fix some error. That leads to
Tip 2: After you install Azure Tools for Visual Studio, run dsinit /sqlinstance:sql_instance_name to create the database needed to run Development Storage.
Since I already have a non-named default SQL Server instance, I ran dsinit /sqlinstance:. (dsinit /sqlinstance "colon" "dot"), as "dot" is the name for a default SQL Server instance. Then Dev Storage started up ok.

Thursday, June 17, 2010

Test machine using boot from VHD

Another option to my last post on SharePoint test machine setup is to boot from a VHD file. A VHD is a Virtual Hard Disk, a file that is used as a hard disk on a Virtual PC or Hyper-V Virtual Machine.

I followed the instructions on Marin Frankovic's blog about it, and it was very easy to create an easy-to-rollback, boot-from-vhd test environment. That's what I did:
  1. I used Marin's post to install a fresh Windows 2008 boot.
  2. I then created a differencing vhd based on the new W2K8 boot, using diskpart and running the diskpart command create vdisk file=c:\testdiff.vhd parent=c:\test.vhd maximum=size_in_mb type=expandable (or fixed). This is nice because you can create a initial differencing VHD from a base VHD, put aside a copy of this differencing VHD, and "destroy" your new boot with tests. When you want to rollback the "destruction", just throw away the differencig file your were using, and start with a fresh new copy from the VHD you put aside before.
  3. Next I added the boot entry to this differencing vhd. On a command prompt:
    a. bcdedit /copy generates boot entry copies. There's plenty of references on this, google for some.
    b. Run the following to point the new boot entry to the differencing VHD:
    bcdedit /set {boot_identifier} device vhd=[c:]\path_to_vhd\vdhfile.vdh
    bcdedit /set {boot_identifier} osdevice vhd=[c:]\path_to_vhd\vhdfile.vhd
    bcdedit /set {boot_identifier} detecthal yes
    (the boot identifier is shown when you generate the boot copy with bcdedit /copy. It can also be seen f you run bcdedit with no params)
And that's it. Your tests boots now can use the full power of your machine, RAM & CPU, instead of sharing the (precious) hardware with the host OS, as VM's do. Just remember: boot from VHD is supported only if your OS is W7 Ultimate or Enterprise, or W2K8 R2.

Thursday, March 25, 2010

SharePoint 2010 Test Machine Setup

Some facts on my SharePoint 2010 test environment setup:

1. Some useful links
2. The SharePoint Demonstration Virtual Machine
  • It's a complete test environment for SharePoint 2010, comes pre-loaded with SharePoint Server 2010, Office 2010, SharePoint Designer 2010, an Active Directory domain, Visual Studio 2010, SQL Server 2008 + Analysis & Reporting Services, Exchange Server 2010 (Exchange on a second VM), and several sample sites with data on it. It saves a lot of work.
  • SharePoint 2010 is a *64-bit only* software, so you can't create its VM's on Virtual Server or Virtual PC, since they don't support 64-bits VM's.
    • Since the VM guest operationg system has to be 64-bit, you will have to user Hyper-V, wich only runs on Windows 2008 machines.
    • If you have a desktop that has been more off than on since you got that notebook you are using now, a "lighter" option is to download (free) and intall Hyper-V Server 2008 R2. It's a stripped down version of Windows 2008 designed solely to run VM's and with support for remote VM management (so you will work from the new note ;-). My 3GHz Pentium D (yes, Dual Core, not Core2 Duo) with 6GB RAM could handle the SharePoint 2010 VM reasonably.
Aside from that, you do can install SharePoint 2010 Beta on Windows 7 and Vista (provided that they are 64-bit installations), but it seems too much trouble just for setup a test machine. If you have a Windows 2008 machine, create the VM on Hyper-V, attach the VHD, and that´s it. If not and you have a second machine at hand, go for Hyper-V Server. It took far more time for me to download the Hyper-V Server setup than to get the SharePoint VM running, so that's my suggestion for you.

Note: the only thing I had to change on MS SharePoint Demonstration VM was to fix the virtual network adapter IP address to 192.168.150.1, wich is the address the DNS entries are setup to. and that's it. That took some time to figure out, but not that much... ;-)

Note2: Check out this post too: "Test Machine Using Boot From VHD". Booting from a VHD improves the performance of your test machine, because there's only one operating system running - instead of two, as when you use virtual machines.

Friday, February 26, 2010

SharePoint: The site theme is not applied to my custom page

If you created and/or customized pages in a SharePoint 2007 site, and when changing the site theme this change does not appears on the customized pages, one possible cause is the absence of the ASP.NET server tag that includes site themes on the page. Try placing the following markup on the <head> session of the page:

<SharePoint:Theme runat="server">

This server control writes the <link> tag that includes the selected theme CSS styles on the generated HTML.

Tuesday, February 2, 2010

Using Microsoft.SharePoint.dll to find out the ID of a list

When moving a site between web applications using SharePoint Designer backup (Site > Administration > Backup Web Site menu), several web parts wich had been converted to XSLT were displaying a "strange" message:

The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator.

When an web part is converted to XSLT, SharePoint Designer places on the page a control of type WebPartPages:DataFormWebPart to display the data. This control uses the list ID to specify wich list is the data source (each list in a SharePoint site is given a GUID as its identifier, wich is stored in the list's ID property). Well, when the site was recreated at the destination, so were its lists, and that generated new ID's to them. And the web parts could not find their lists anymore, so they stopped working.

Being a restless geek, I decided to test the classes on Microsoft.SharePoint.dll by coding a little console app that listed the ID's from a SharePoint site lists. The code is bellow, and can be used as an intro to classes in namespace Microsoft.SharePoint. If you want just the app, just download the following file and run it from a command prompt on your SharePoint machine: SPListId.zip.

Imports Microsoft.SharePoint

Module Module1

Sub Main()
Try
Console.WriteLine()
If My.Application.CommandLineArgs.Count = 0 Then
Console.WriteLine("SPListId - Lists IDs from lists in a SharePoint site")
Console.WriteLine("Copyright (c) 2010 SrNimbus. No rights reserved ;)")
Console.WriteLine("Usage: SPListId site_url")
Return
End If
' The System.Uri class helps manipulating network addresses
Dim urlSite As Uri = New Uri(My.Application.CommandLineArgs(0))
' The Microsoft.SharePoint.SPSite class represents a site collection on SharePoint
Dim siteCollection As New SPSite(urlSite.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped))
' The Microsoft.SharePoint.SPWeb class represents a site on a site collection
Dim site As SPWeb = siteCollection.OpenWeb(urlSite.AbsolutePath)
Console.WriteLine("Lists on {0}:", urlSite.OriginalString)
Console.WriteLine("------------------------------------")
' The SPList class represents a SharePoint list
For Each lista As SPList In site.Lists
Console.WriteLine("{0}: {{{1}}}", lista.Title, lista.ID.ToString().ToUpper())
Next
Console.WriteLine("------------------------------------")
Catch erro As Exception
Console.WriteLine("Ooops:")
Console.WriteLine("{0} - {1}", erro.Source, erro.Message)
Finally
Console.WriteLine()
End Try
End Sub

End Module

Remember to add a reference to Microsoft.SharePoint.dll in order to compile the project. It is located on the SharePoint server, at %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI.

Monday, January 25, 2010

SharePoint 2007 Content Deploy Quick Start Guide

And there was I working my 455 off preparing for teach Microsoft´s 50149 SharePoint Operations training when...
A word of advise: stay away from this training. The author tries to show EVERYTHING about SharePoint operations but there's no details on *any* of the topics shown. The result is frustrated and/or distracted students, and that's a saddening thing to me as an instructor - not to mention to the students...
Well, there I was studying the module on Content Deployment when I stumbled upon this guide from Stefan Gossner (great SharePoint blog!). It gives a quick and straightforward view on the main points about Content Deplyment on SharePoint 2007. Nice reading if you are new to the subject. Till now, the guide covers the following:

Part 1 - The Basics
Part 2 - The Basics continued
Part 3 - Configuration
Part 4 - Communication
Part 5 - Quick Deployment
Part 6 - Logging
Part 7 - Change Token Basics
Part 8 - Job and Change Token

Part 1 has an link index to the other parts. Enjoy!

Tuesday, December 29, 2009

Windows Virtual PC: Where is it?

Windows Virtual PC is Microsoft Virtual PC next version. It runs on Windows 7, but it is NOT part of it - you have to download it. The download page is http://www.microsoft.com/windows/virtual-pc/download.aspx, although the page title is "Download Windows XP Mode". You have to fill in the two dropdowns, and the page shows you two links. If you don't want Windows XP Mode, just click the second link, download and install the update to Windows 7 - it's Windows Virtual PC that's being installed.



Before you download it, you have to check if your's computer processor supports hardware virtualization technology (check out the links on Intel and AMD on the article). Most of the newer processors (post 2006-) ship with it. Some don't (for example, the T6670 on my Dell Vostro 1310 does not :-P). You can run the Hardware-Assisted Virtualization Detection Tool from Microsft to confirm that your processor supports VT (virtualization technology). If it doesn't, download Virtual PC 2007, the previous Windows Virtual PC version. It has less features, but it's disks are compatible with Windows VPC.