Sunday, March 28, 2010

Why Fx Cop recommends String.ToUpperInvariant for normalizing ?

I used to normalize strings using lower case from Visual Basic 5.0 era before a string comparison activity. While executing Microsoft FX Cop on a recent SharePoint project, FX Cop rule #CA1308 stumbled upon on many places and recommending to convert to upper case invariant for normalizing.

As usual Microsoft doesn't have proper documentation and I'm just looking for what's the difference between ToLowerInvariant & ToUpperInvariant in terms of performance. Michael Kaplan's blog reveals the difference.

All Microsoft NTFS filesystems follow the normalizing to upper case, so the framework developers just followed the NTFS standards. The NTFS filesystem contains a metafile named $UpCase which is a table of unicode uppercase characters for ensuring case insensitivity in Win32 and DOS namespaces. This $UpCase file contains the upper case conversion table for NTFS file systems.

Now the question is why NTFS is following upper case conversion standards, there are some language scripts which doesn't have lower case letters. So for these scripts if we apply the lower casing logic this will also produce the upper case letters producing a round trip. To avoid this Microsoft seems to follow this upper case standards

Tuesday, March 16, 2010

Stumbled upon "Assembly fabrikam could not be uninstalled because it is required by other applications"

Ever struck with this nasty error message from GAC while uninstalling a library




Actually we were experimenting MSI installers to deploy some of our prerequisite libraries to global assembly cache to save some time on preparing the deployment scrips. I've been using these dlls which were deployed using installers in my dev environment. When I tried to uninstall these libraries, I was beating the bush around with this error message.

It leads to learning of traced reference count on assemblies here. The quick fix is to open the registry, navigate to the following hierarchies and remove your assembly entries

[HKCU\Software\Microsoft\Installer\Assemblies\Global]

[HKLM\SOFTWARE\Classes\Installer\Assemblies\Global]

Lessons learnt : Don't try MSI installers on an environment where you do a very frequent patch releases (of course in Dev Environment too). Stick to the basic Gacutil tool

Friday, December 4, 2009

Fixing UserProfileException while installing SharePoint Server 2010


  1. Microsoft.Office.Server.UserProfiles.UserProfileException

    The request channel timed out while waiting for a reply after 00:00:18.7285970.
    Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding.

    One of the clear exception which says what to do while installing the beta product

    Navigate to the following path and open the client.config file \14\WebClients\Profile\client.config

  2. Find the tag increase the default sendTiemout attribute value to few minutes instead of seconds sendTimeout="00:15:20"

  3. Rerun the Psconfig wizard

After a long struggle managed to deploy SharePoint 2010 in a Vmware dev environment



Wednesday, December 2, 2009

VirtualBox memory limitation plays spoilsport in Sharepoint 2010 installation

As a believer of virtualized development environment, I've started building the development environment for SharePoint 2010 using Sun Virtualbox. I've shared initially 1 GB of Ram out of 4 GB from my 32 Bit Vista host which eventually fell short after installing the Pre-requisites of SharePoint 2010

After facing a lot of screen freezes and high memory consumption in my guest (Windows Server 2008 SP1) I've increased the shared memory to 1.50 GB. SharePoint 2010's psconfig proved that is too low after 8 of 10th step throwing a WCF timeout exception. No luck even after relaxing the timeout values ,not able to complete psconfig and not able to pull down the processor/memory consumption

Frozen VirtualBox



So SharePoint 2010 requires more memory to be shared in its virtualized environment, there comes the issue. There's no way to increase the shared memory beyond 1500 MB with my current hardware setup(32 bit Vista Home premium with 4 GB RAM)

This limitation is forcing me to evaluate using VMware, so for the time being good bye for the cross platform hypervisor Virtualbox

Top memory comparison with VMWare

Friday, November 20, 2009

How to share files in Sun Virtual Box ?

Shared folders allow you to access files of your host system from within the guest system, much like ordinary shares on Windows networks Sharing folders in Microsoft virtual PC is much simpler than in virtual Box. Just adding the shared folder will add a new mapped icon in "my computer" to provide access to host files

This is not the case in Virtual box, sharing is accomplished using a special service on the host and a file system driver for the guest, both of which are provided by VirtualBox.To share a host folder with a virtual machine in Virtual Box, you must specify the path of that folder and choose for it a "share name" that the guest can use to access it.

After this step I'm expecting a new drive in "My Computer" as a typical Microsoft Virtual PC user. But there is no new drive. After digging into the help files, Virtual Box requires a explicit "net use" command to mount that shared drive.

net use x: \\vboxsvr\sharename


vboxsvr is a fixed name(might be helper service which runs on the guest along with Guest additions), "sharename" is the alias name which is provided while mapping the host drive

Virtual machine guest additions installation is a pre-requisite for folder sharing

Monday, November 16, 2009

Where is Windows Server 2008 SP1 ?

While preparing a Windows server 2008 virtual machine and as usual I was just looking up Microsoft.com for patching my newly installed operating system(to get the bug fixes).

Interestingly I was not able to find Windows Server 2008 SP1, there is only SP2 available and came to know that the initial OS installation includes the SP1.

FAQ Section of Windows Server 2008 SP1 clarifies the doubt,Following text taken from the FAQ

Are there any prerequisites for SP2?

You must have Windows Vista with SP1 or Windows Server 2008 installed on your computer before installing Service Pack 2. (Windows Server 2008 shipped with Service Pack 1 included.)

Screen shot after the clean installation of Windows server 2008



SharePoint server 2010 preparation

As SharePoint server runs only on 64 bit platform, all working virtual machines becomes useless and need to start with a clean slate. It's time to build a new virtual machine but unfortunately our Microsoft Virtual PC cannot be able to run 64 bit machine within.

SharePoint server 2010 can be installed on Vista/Windows 7/ Windows 2008 Server Operating systems. So it's a clear message from Microsoft that Virtual PC will not be upgraded to support 64 bit instances. Either run SharePoint on your desktop or go for third party virtualization solutions such as Vmware or Sun Virtual box. As the later is a free offer from Sun Micro, I prefer to go with Virtual box.

Prior to that you need to check whether you lap/desk top supports 64 bit virtualization. Use VMware 64 bit Compatibility checking tool and find out whether your hardware supports 64 bit virtualization. Use this processor check guide from Vmware for supported micro processors.

At last Sun virtual Box rocked by hosting the 64 bit guest on a 32 bit Vista box


It's time to learn new things right now which are integrated right into the heart of SharePoint 2010 till I get the CTP edition from MSDN.

Things are which are new in SharePoint 2010
  • PowerShell - an ultimate scripting engine which will surely replace the STSADM management console from administrators
  • Jquery - A lightweight javascript library which comes with OOB product
  • SilverLight - Version 3.0 looks much solid with its new controls and RIA services
  • Windows Communication foundation - Guy who replaces the SSP in MOSS
  • Visual Studio 2010 - Recommended IDE for SharePoint server 2010 which comes with tight integration like F5 execution and much better project templates than VseWss extensions. Still I need to explore more