Skip to content
/

With the introduction of the August Cumulative Update for SharePoint 2007 (KB973399) we encountered “System.NullReferenceException: Object reference not set to an instance of an object.” on all pages inheriting from MySitePublicWebPartPage.

The problem

With the introduction of the August Cumulative Update for SharePoint 2007 (KB973399) we encountered System.NullReferenceException: Object reference not set to an instance of an object. on all pages inheriting from MySitePublicWebPartPage.

Stack Trace of the exception

As can be seen in the stack trace the error occurs from a call by the ProfilePropertyImage control, which is on the page by default.

The cause

This call was not present in the control prior to the august update, so let’s take a look at the description of the update (KB973409).

A Shared Services Provider administrator edits the About me property or the Picture property to make the property display “Only me”. However, these properties continue to be visible when the profile owner sets their As Seen By option to “Everyone”, “My Colleagues”, “My Workgroup” or “My Manager” on their own Person.aspx page.

So, this explains why the control was changed, it now looks if the image should be rendered for the current visitor of the page.

The reason

We already know the problem starts inside the ProfilePropertyImage which is calling the MySitePublicWebPartPage.GetEffectivePrivacy method. This method reads the value of the MySitePublicWebPartPage.PrivacySelected property. Inside the getter of the property the following code is used:

object obj2 = this.ViewState["__PrivacySelected__"];
return (Privacy) obj2;

As we all know SharePoint's code is never about defensive programming and so is the case here if there is no ViewState Property available, it will return a null. And of course, there is no check anywhere for that.

But this code works for the default person.aspx page, so the setter for this property has to be called somewhere. Analysis of the code shows only the AsSeenBy class ever calls the setter. As this control is on the person.aspx page by default, the property is set and that page works fine. As we do not have this control on our page, we get a NullReferenceException.

The solution

If you are bound to the August release the solution is simple: add the AsSeenBy control to your page.

But what if you do not want to have the control on your page? We get lucky, because if you do not make it visible it will still work, so add:

<SPSWC:AsSeenBy runat="server" id="ddlAsSeenBy" SelectionMode="Single"
                autopostback="True" Visible="False" />

If you are not bound to the August upgrade you can upgrade to the October Cumulative Update or newer. Microsoft has fixed the issue in those versions.

/

Stefan Goßner reminds us of the fact that support for WSS 3.0 SP1, SharePoint 2007 SP1 and Project Server SP1 will soon end.

Update on
Microsoft extends support for WSS 3.0, SharePoint 2007 and Project Server SP1

Stefan Goßner reminds us of the fact that support for WSS 3.0 SP1, SharePoint 2007 SP1 and Project Server SP1 will soon end.

read more...
/

I was having trouble with the clock in my Linux Hyper-V VM’s. The time was constantly drifting forward. Using NTP only slowed the drift a bit down but often NTP gave up after several days.

I was having trouble with the clock in my Linux Hyper-V VM’s. The time was constantly drifting forward. Using NTP (Network Time Protocol) only slowed the drift a bit down but often the NTP service gave up after several days.

read more...
Filed under Hyper-V
Last update:
/

I’m running Linux in Hyper-V VM’s since the launch of the Windows Server 2008 RTM. It was quite complex to get performance and support for the network drivers.
Recently with the launch of Windows Server 2008 R2 there are also new Linux Integration Components which also work for 2008 RTM.
Here is the list of steps to install CentOS with these components.

I am running Linux in Hyper-V VM’s since the launch of the Windows Server 2008 RTM. But in the beginning it was quite complex to get real performance and support for the network drivers.

Recently, with the launch of Windows Server 2008 R2, there are also new Linux Integration Components which also work for Windows Server 2008 RTM. So here is the list of steps to install CentOS with the integration components.

  1. Download the latest CentOS distribution from https://vault.centos.org/5.0/isos/ (I use the x86_64 version).
  2. Create a VM, I suggest:

    >400MB memory
    Add a Legacy Network Adapter (connect to network)
    Add a Network Adapter (connect to network)

  3. Mount the CDROM and install CentOS (I use the minimal setup)
  4. After the installation is done make certain you are up to date
    yum update
  5. Install the required components for the Linux Integration Components
    yum install gcc make gnupg kernel-devel
  6. Reboot into the latest kernel
  7. Download the Linux Integration Components
  8. Mount the CDROM and copy the contents
    mkdir -p /mnt/cdrom mount /dev/cdrom /mnt/cdrom cp -rp /mnt/cdrom /opt/linux_ic umount /mnt/cdrom
  9. Build the drivers
    cd /opt/linux_ic ./setup.pl drivers
    If you get the message No kernel-xen-devel or kernel-source package installed. You must install this package before installing the drivers. edit the setup.pl file and change the following:
    -$kernel = `rpm -q kernel-xen-devel`;
    +$kernel = `rpm -q kernel-devel`;
    If everything went OK you can now see a new nic (network interface controller) called seth0 using ifconfig
  10. You can now remove the Legacy Network Adapter.

Remember, every time you update the kernel you have to run the setup.pl drivers command.

Filed under Hyper-V
Last update:
/

When I’ve to connect to the same development machine over and over again using RDP I store the credentials.
But when I later connect again I’ve to still provide a password.
After entering my password 1387 times in the last year I started searching for the reason why it doesn’t use my stored credentials. As it turns out this is because of a local policy.

The problem

When I have to connect to the same development machine over and over again using RDP, I want to store the credentials.

First logon attempt

But when I later connect again, I still have to provide my password.

read more...
Filed under Windows
Last update: