Olav Aukan Getting information off the Internet is like taking a drink from a fire hydrant…

4Mar/10

Error when editing People Search Core Results Web Part XSL

Today I was tasked with removing the "Add to My Colleagues" link from the people search results. I figured this would be easy, just edit the XSL of the People Search Core Results Web Part. I simply commented out the part that added the link:

<xsl:template name="DisplayAddToMyColleaguesLink">
   	<xsl:param name="url"/>

<!-- Remove "Add to My Colleagues" link

    <a href="{$url}">
		<xsl:value-of select="$AddToMyColleaguesText"/>
    </a><br/>

-->

</xsl:template>

I then went on to save the changes but much to my surprise (and horror) the Web Part displayed the following error:

System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)...

Of course I assumed I had somehow made the XSL invalid with my editing, so I pasted in the original and clicked Save again, but the error would not go away. Unable to resolve the issue I ended up discarding the checkout and starting all over again. This time I did a simple Select All -> Copy -> Delete -> Paste, but even without making any modifications to the XSL I got the same error.

After some googling I found out that this is a known bug, and the workaround is to simply check in and publish the page. I did so, the error went away, and the "Add to My Colleagues" link was now gone from the search results.

4Mar/10

Error when uploading large files to SharePoint running on Windows Server 2008

A client was having problems uploading a 29 MB file to their SharePoint server. Internet Explorer would simply show the "This page can not be displayed" error page, so I figured the maximum upload size was probably set too low.  There's two ways to set this limit; through SharePoint Central Administration or with STSADM.

Using SharePoint Central Administration

  1. Click Start -> All Programs -> Administrative Tools -> SharePoint Central Administration
  2. Click Application Management -> Web application general settings
  3. On the Web Application General Settings page, click the Web application that you want to change.
  4. On Maximum upload size, type the maximum file size in megabytes that you want, and then click OK.

You can specify a maximum file size of 2047 MB.

Using STSADM

To set the max upload size to 100 MB use the following command:

  1. Click Start -> Run
  2. Type 'cmd' and click OK.
  3. Type 'stsadm -o setproperty -pn max-file-post-size -pv 100 -url http://server' and hit Enter.

However in the client's case the maximum upload size was already set to 100 MB, so clearly this was not the cause of the error. I thought maybe IIS was timing out, but realized that this couldn't be the problem either since the error happened the second the user clicked the Upload button and not 120 seconds later as would be expected with a time out. The default timeout value is 120 seconds, and I confirmed that this had not been changed.

It turns out this is an issue related to Windows Server 2008 when uploading files bigger than 28 MB as described in the bottom of KB925083. The solution is to add the following snippet of XML to the web application's web.config file after the <configSections> tag.

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="104857600"/>
    </requestFiltering>
  </security>
</system.webServer>

Replace the actual value with the max upload size for you web application in bytes (1 Megabyte = 1048576 Bytes ).

2Mar/10

Small Basic – Because it’s never to early to start programming!

I don't remember exactly how old I was when I first started programming, but it was somewhere in early primary school. My dad had just bought us a used Commodore 64 and I started playing around with the Commodore Basic programming language. Those of you who remember BASIC probably also wrote something like this at one point:

10 PRINT OLAV IS COOL!
20 GOTO 10
RUN

Yeah it was fun, but not terribly useful, and doing anything graphical was a nightmare. However it was enough to spur my interest in programming in general, and after a few years on an IBM PS/2 8086 with QuickBASIC I eventually graduated to Visual Basic 4.5 with WinForms and the rest is history. Had it not been for these early years I might never have become a developer in the first place.

I don't have any kids, but I imagine there's alot of fellow developers out there who do, and I'm sure some of you might already have thought about what your kids will grow up to be one day. I'm not really a fan of parents telling their kids what career to choose, but as Homer Simpson once said "It never hurts to grease the engine a little!".

So if you want your kid to get the taste for programming why not introduce them to Small Basic? It's educational and might be the beginning of a long and prosperous life in the "wonderful world of software development".

2Mar/10

HTC HD2 Not Upgradeable To Windows Phone 7 After All

There's been rumors going around that HTC is planning to upgrade the HD2 to Windows Phone 7 when it's releases some time this fall. The HD2 is supposedly the first device to meet the hardware requirements for Windows Phone 7 with it's Snapdragon 1GHz CPU, 448MB RAM and 4.3" touch screen.

There seemed to be hope for an upgrade when HTC Russia's twitter account apparently confirmed that the HD2 is the only currently available device that will get Windows Phone 7. Later however this was retracted.

The latest update seems to be from Microsoft’s General Manager for Mobile Business Asia-Pacific Region, Natasha Kwan, who recently told APC Magazine that "Because we have very specific requirements for Windows Phone 7 Series the current phones we have right now will not be upgradable."

Apparently this is because of new requirements from Microsoft that all Windows Phone 7 devices must adhere to the "Three Chassis" specification, and the HD2 does not. It seems that despite it's impressive hardware specs the HD2 will be denied Windows Phone 7 simply because it does not have the correct number of buttons...

That being said there is currently an ongoing petition to make an exception for the HD2, and even if that doesn't work I suspect there will be lots of unofficial ROMS on XDA-Developers for the more adventurous users.

I suspect many users will be disappointed to find out that despite having the most impressive hardware on the market they will be stuck with an ever more outdated operating system with no official upgrade path. I wouldn't be surprised to see windows mobile sales drop when users realize this.

1Mar/10

Remote Desktop In Landscape Mode On HTC HD2

Remote Desktop Mobile has been around for a while, but up until now it's not been very user friendly on most mobiles because of their tiny screens. The HTC HD2 however has a 4.3" screen with a resolution of 800 x 480. Add multi-touch to this and we should be set for a pretty decent remote desktop experience! There is just one little problem; Remote Desktop Mobile does not auto-rotate into landscape mode...

Despair not! This can be achieved with a quick registry edit. You'll need a registy editor like PHM (free) or Resco Explorer. Once you've got a registry editor, fire it up and make the following changes:

Go to [HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\ModuleName]
Add a new string value called "Remote Desktop Mobile" with the value "\Windows\wpctsc.exe".

Go to [HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\WhiteList]
Add a new string value called "Remote Desktop Mobile" with the value "TSSHELLWND".

Reboot the phone for the changes to take effect.

Now when you start Remote Desktop Mobile and turn the phone sideways you get landscape mode.

Before you connect go to Options and set 'Colors' to High Color (16bit), check 'Full screen' and 'Fit remote desktop to screen'.

An the end result? This is what Windows 7 looks like through Remote Desktop Mobile on the HTC HD2 in fullscreen.