Archive for the ‘microsoft’ Category

No More *BEEP*

Tuesday, May 6th, 2008

I might have happened to you too: make some error in a Windows virtual machine and your system will *BEEP* out loud. Not some nice and fancy WAV/MP3 sample, but a raw *BEEP* coming straight from your system’s motherboard. This *BEEP* does not respect your speaker volume and mute settings. And it will probably irritate most people who sit near you.

Fortunately getting the beep to shut up forever is relatively simple. Here’s how to do it:

  1. Open a Command Prompt window (in Vista make sure you open it using the “Run as administrator” option).
  2. Use the following commands:
    • To stop the Windows Beep Service:
      net stop beep
    • To make sure it never gets started again:
      sc config beep start= disabled

That should take care of them BEEPs :-)

.NET 3.5 Enhancements Training Kit

Thursday, April 17th, 2008

The Visual Studio & .NET Framework Evangelism team did it again. After their cool .NET 3.5 Training Kit they are now working on the follow up: the .NET 3.5 Enhancements Training Kit. It’s not final yet, but still very interesting!

Currently, the training kit contains six hands-on labs, made up of the following technologies:

  1. ADO.NET Data Services
  2. ADO.NET Entity Framework
  3. ASP.NET AJAX History
  4. ASP.NET Dynamic Data
  5. ASP.NET MVC
  6. ASP.NET Silverlight controls

Read more about it on Jonathan Carter’s blog.

Beware of the SharePoint Memory Leaks!

Wednesday, March 12th, 2008

Beware of the SharePoint Memory Leaks!

You might not know it, but when developing for SharePoint (either WSS 3.0 or MOSS 2007) it is very easy to cause memory leaks, which can ultimately thrash your SharePoint server’s performance. The reason for this is that even though your own code might be written using only managed code, the SharePoint API still uses unmanaged code in some places. These unmanaged resources have to be explicitly disposed of, especially considering the fact they are living inside an ASP.Net web application (SharePoint) and potentially can have a long lifetime.

The problem is that the SharePoint API doesn’t always make clear when exactly you have to dispose of objects explicitly. Sometimes it may look like you’re just inspecting a value of a property, while in the background a whole new object is instantiated, which holds valuable unmanaged resources that should be freed by the caller (you!). Other times you might find yourself disposing an object, only to find out you weren’t supposed to…

Way back in June 2006 Microsoft employees Scott Harris and Mike Ammerlaan released their article Best Practices: Using Disposable Windows SharePoint Services Objects on MSDN, which can be regarded as the mother of all articles on this subject. I think this article is often overlooked and should be considered essential reading material for every serious SharePoint developer out there. Also read their more recent article called Best Practices: Common Coding Issues When Using the SharePoint Object Model, which also handles topics like data and object caching and writing scalable code.

Recently two other Microsoft employees also wrote interesting pieces on this subject. Stefan Goßner did a piece called Dealing with Memory Pressure problems in MOSS/WSS, in which he explains what a "Memory Pressure Situation" is and he lists some common causes and solutions for it. The other interesting read came from Roger Lamb. His entry is called SharePoint 2007 and WSS 3.0 Dispose Patterns by Example and in it he shows some very clear code samples and patterns on how to properly handle SharePoint objects.

Very cool material, guys!

Return of SmartPart V1.3 released

Friday, February 15th, 2008

Yesterday Jan Tielens released a new version of his famous SmartPart to the community. It is now at version 1.3 and here’s the changelog:

  • Added a setup wizard to install the Return of SmartPart.
  • Added sample user controls (including connectable user controls and AJAX user controls).
  • Added localization support for ASP.NET AJAX user controls.
  • Various minor bug fixes.
  • Nice 2-minute screencast on how to deploy and test the SmartPart.
  • 64 bit version available.

Great work, Jan! I also like the fact you’ve used Lars Fastrup’s SharePoint Solution Installer for deploying SmartPart.

Vista SP1 setup language pack error

Friday, February 15th, 2008

Right after I finished my previous blog post I started to install Vista SP1 myself. Unfortunately right after executing the installer I got a nice little messagebox, saying Vista Service Pack 1 setup couldn’t continue, because my version of Vista was unsupported. Now I run the English language version of Vista Ultimate (32 bit), so at first I couldn’t figure out why I got this error.

Then I looked at the error message more closely (unfortunately I cannot remember the exact words anymore) and noticed it said something about unsupported language packs being installed on the system (Vista SP1 is currently only available for the English, French, German, Japanese and Spanish language versions of Vista). I did remember seeing several language pack updates appear during a Windows Update session way back when I first installed Vista on this machine. However I couldn’t remember installing any of them.

To be sure I checked the Vista installed Programs and Features list for any installed language packs, but couldn’t find any. Using Google I found this article about Vista Language Packs and at the bottom of this article there were some instructions on how to remove a Vista language pack. It turned out installed Vista language packs aren’t listed in the Programs and Features list, but at a different location.

To cut a long story short, it turned out I had once installed the Dutch Vista language pack and had forgotten all about it. Unfortunately the mere presence of this Dutch language pack blocked the whole Vista SP1 installation! So I quickly uninstalled the language pack, which solved my problem.

For those interested, here are the instructions for uninstalling a Vista language pack:

  1. Click Start, and then click Control Panel.
  2. In Control Panel, click Clock, Language, and Region, click Regional and Language Options, and then click Change display language.
  3. On the Keyboard and Languages tab, click Install/uninstall languages under Display language.  If you are prompted for an administrator password or for confirmation, type the password, or click Continue.
  4. In Choose to install or remove languages, click Remove languages
    Under Select the languages that you want to remove, select the language that you want to remove, and then click Next.
  5. Click the language that you want to remove, and then click Remove.