Thursday, May 27, 2010

Are you planning to practise SharePoint 2010 with zero set up and configuration

Download the pre-configured Hyper-V SharePoint 2010 Evaluation and Demo Virtual Machine (~1.8GB) along with the SharePoint 2010 Walkthrough Guide for a chance to get hands on with SharePoint 2010 with zero set up and configuration.

but take a look at the system requirements, it might soar a bit

System Requirements
  • Supported Operating Systems: Windows Server 2008 R2
Additionally you will need:

  1. Windows Server 2008 R2 with the Hyper-V role enabled.
  2. Drive Formatting: NTFS
  3. Processor: Intel VT or AMD-V capable
  4. RAM: 8 GB or more recommended
  5. Hard disk space required for install: 50 GB

Thursday, April 29, 2010

How to get NT AUTHORITY\Authenticated Users group using .NET object model

Yes obviously I can hard code a string constant for the value and use the string "NT AUTHORITY\Authenticated Users but I hate hard coding values if the object model is rich enough to provide me a way.

Following method will return NT AUTHORITY\Authenticated Users group as a string

public static string GetNTAuthenticatedUsers()
{
return new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null).Translate(typeof(NTAccount)).Value;
}

Wednesday, April 28, 2010

Global Assembly Cache goes empty


While doing the development on a SharePoint machine, it is frequent to deploy the dlls in GAC and resetting the IIS or recycling the application pool. one day the GAC goes empty and all of us sudden we are not able to deploy the library to the GAC. It had a solution of restarting the development machine but this issue is frequent among the team members


Solution for this is to navigate to Start-> Run - >services.msc and find "Indexing services" stop/restart the service and reopen the assembly window. There you go . .. .

Fix : Location.href not working in IE 6

We recently tried to do a post back of a page based on a user input in a text box, the postback will be triggered by a ASP LinkButton. ASP Linkbutton renders as an anchor tag with the href populated with javascript:WebForm_DoPostBackWithOptions. So the challenge is to set the window.location to the javascript:WebForm_DoPostBackWithOptions

window.location= javascript:WebForm_DoPostBackWithOptions .. . ..

The location can be a URL too, in our case it is just a post back script

It works like a charm in IE 8 but it doesn't even show a sign in IE 6. We tried many variations window.location=, window.location.href= ,window.location.href.assign but nothing worked out.

After few hours of googling and surfing the web we found that we need to add the following line to get it worked in IE 6

window.event.returnValue=false;

At last the final code looked like this

if (evt.keyCode == 13)
{
window.event.returnValue = false;
window.location = 'http://www.google.com";
return false;
}

hope this helps someone .. .

Tuesday, April 20, 2010

Silverlight on Symbian platform

While Adobe is still struggling to get it Flash to iPhone platform, Microsoft released silverlight for Symbian platform. this will enable Nokia S60 5th edition to display silverlight content. As Microsoft already enable Silverlight in its mobile operating system now it is extending the technology to another open source smart phone platform.

check out the Nokia beta labs here

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