Saturday, February 16, 2008

What is great about Windows Server 2008?

What are my favorite features of Windows Server 2008?

  • Install experience is way faster. You don't even enter a name for the machine until after the install is complete. This is huge since virtualization is so big and installing Windows Server is happening more and more. This will save the IT industry hundreds of thousands of cumulative man hours.
  • Windows Server 2008 is built for performance, not beauty. This is what I don't like about Vista. It is pretty but terribly slow. I hate when Vista's wastes my time. Windows Server 2008 is focused on performance. Perhaps I'll install Windows Server 2008 on my laptop..
  • Event Viewer is much improved.
  • Interface is written by a non-developer and it is helpful. This is so nice that each tab and button is much more clearly described exactly what the feature does and what will happen when I hit the OK button. This will make me much less nervous about making changes on a production server.
  • The interface is Humane. I read a book a few years ago that influenced me "Humane Interface".

Now you know how some things are just engrained in your brain like they have to be that way and they will never change, and one day someone crazy changes that thing and you realize it really didn't have to be that way. Well that is how I would describe the install of Windows Server 2008: crazy easy. You don't even have to choose a name for the machine until after the OS is installed! woah, who would have ever thought that was possible? You don't select a password until after the install either so, you save so much time installing because you can stick the install disk in and do all the configuration after the OS is installed.


The upgrade from Windows XP to Windows Vista was an un-breathtaking experience, but not this upgrade, I can't breath.. Ok, so a little dramatic there, but man I'm thinking about all the hours of time that I've wasted over the past year that could have been saved if I'd this cool new stuff. I think I'll install Windows Server 2008 on my laptop because it is optimized for performance, now beauty like Windows Vista is. When you accumulating hours of wasted time each week waiting for beautiful windows explorer to load, you don't care about beauty...


  • The event log is great, no more modal dialogs. We are finally out of the 90's modal dialog boxes. (See Figure 1)


Figure 1

  • The default install comes with a shortcut to server manager. Oh, that is beautiful. That alone will save years of my life not having to click on start->program files->admin tools->manage my computer each time I open up a clean image of Windows Server. (see Figure 2)


Figure 2

  • Adding Windows Features is much improved. again no modal dialog boxes, much more descriptive, helpful interface and much more efficient because you can turn on all the features from one place at once, instead of drilling down into window after window.



Figure 3: The old way to add windows features. Tons of nested modal dialog boxes: yuck!

Friday, February 01, 2008

Enabling IntelliSense in Visual Studio - Feature in SharePoint

I've been trying to figure out for a while how to turn on intellisense in visual studio for feature.xml files. Here is the trick, thanks to this post.

Inside the TEMPLATE directory there is a directory named XML that contains several XML schemas, including one named wss.xsd. If you associate this schema file with feature files such as feature.xml and elements.xml, Visual Studio will provide IntelliSense, which makes it much easier to author a custom feature. You may also copy these XSD files into C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\.

Can't install MOSS on a different drive than C:

In production environments, my clients often want to put as little as possible on the C: drive. This is a very good idea for performance reasons. Unfortunately, I confirmed today that you can’t install all the MOSS files on a drive other than the C drive.

During install, WSS/MOSS asks you where you want to install MOSS. Even when you specify a drive other than C during the install most of the files end up on C:. For example I chose the “I:” drive for the install path, but all my “12 hive” files still showed up on the C drive.


Here is my 12 hive on C: even though I installed MOSS on the I: drive.



The one folder that does obey my wishes is the “Microsoft Office Servers” folder. Which is 381 megs and as you can see is on the I: drive.



So it does save you 381 megs that would have gone on the C drive, but you can’t prevent most of the MOSS install files from ending up on the C: drive.

A look under the hood, using Reflector to explore Microsoft.SharePoint.dll


We've all used Reflector to open up a .NET assembly and look at the code. But did you ever think of doing this to the core SharePoint assemblies? I had never thought of it until last week at Sleepless in Dallas, Nadeem Mitha of Infusion suggested it. It is quite instructive, and reveals a couple very important nuances that if you don't understand can make your code very slow.  For example, looking at the SPList.Items property you can see that this property simply calls the GetItems() method to retrieve all items for that list. So here is the kicker, any time you call the Items property it is retrieving all the items in the SharePoint list, even if you just call the Items[0] , SharePoint retrieves all the items in a list and then peels off the first one and gives it to you, very inefficient.


Other classes to look at are  GetItemByUniqueId(Guid uniqueId). You can see that behind the scenes, Microsoft is creating a CAML query and retrieving items. Why Microsoft insists on throwing an exception when no results are found, is beyond me. A simple null would have sufficed, thank you very much!



I always thought the assemblies would have been obfuscated, but surprisingly, and to our benefit, they aren't. Hope this gives you some idea, but I think this is a great tip! It takes a lot of the mystery out of SharePoint, and also shows what the heck Microsoft was thinking.