Archive for May 2008


Throw Exceptions Responsibly

May 26th, 2008 — 10:41 am

Recently I had to spend some time to fix a crash in the application I’m working on: I kept getting an OutOfMemoryException with no relation to the amount of free memory on the computer.

Eventually I found the bug: turns out the DrawArc method doesn’t like to be called with a very small angle, so it goes BOOM.

Another tidbit I found while searching for the cause was the fact this behavior is not unique to this method:

“The thing I can add about this is that GDI+ tends to throw OutOfMemoryException when something else is going on. I’ve seen people complaining about this in the newsgroups and elsewhere on the internet.

So we have here a framework with the habit to fail very un-responsibly.

Hmm, why does that sounds familiar?

Somehow I get the feeling that while Microsoft employ 50 people to handle a single feature, no one is left to take care of exceptions and errors in their products.

(in the photo: Windows Vista security exception)

1 comment » | Programming

Happy birthday to this blog

May 22nd, 2008 — 01:25 pm

Although I actually started this blog on 02/2007 (covering the first Microsoft developer academy event), I began using Google analytics one year ago.

Let’s start with the top 10 most popular posts:

  1. WebBrowser.DocumentCompleted is raised more than once
  2. Help file generation for framework 2.0
  3. Five steps for creating a transparent user control
  4. How to be a better team leader
  5. The high cost of Visual Studio Express edition
  6. Reinventing the wheel
  7. List of TFS tools on CodePlex
  8. “Cannot call methods on bigint” error
  9. Validation of a NumericUpDown control
  10. Generic Singleton Factory

My readers mostly use Windows (over 90%) and IE (60%) and are from all over the world:

  1. United States (33%, with the largest % from California and also many visitors from Texas, Washington, New York, Florida)
  2. Israel (15%)
  3. United Kingdom
  4. India
  5. Canada
  6. Germany
  7. Australia
  8. Netherlands
  9. France
  10. Russia

After writing in this blog for a while I decided to start another blog, which is a combination of Hebrew and English posts, so here are some popular posts from there:

Comment » | Blogging

Tech Ed Israel 2008 lectures for English speakers

May 18th, 2008 — 01:22 am

Although TechEd 2008 Eilat (Israel) was mostly aimed towards Hebrew speakers, some of the lectures were given by English speaking Microsoft employees.

You can find additional information (as well as download links) for the following lectures here: Tech Ed Israel 2008 lectures for English speakers

  1. A Lap Around Visual Studio 2008 IDE and VB 9.0
  2. ADO.NET Data Services Framework - aka Project Astoria: REST data services for the Web
  3. Building Composite WPF Applications Using Project Codename - Prism
  4. Building Rich Internet Applications with ASP.NET AJAX and Web Client Software Factory 2.0
  5. Consuming and Creating RESTful Web Services with .NET
  6. Go Gold with Silverlight 2.0
  7. Hyper-V Architecture and Scenarios with Demos
  8. Implementing Workflow Enabled Services and Durable Services using .NET Framework 3.5
  9. Introduction to F#
  10. Introduction to the ADO.NET Entity Framework
  11. Making Your Phones Ring With Software + Services
  12. Putting The User Back Into Architecture
  13. Scale out your applications with Windows Communication Foundation and Windows HPC Server 2008
  14. Sharing Assets Between the .NET Compact Framework and the .NET Framework
  15. SOA, S+S, and Microsoft: A Perspective
  16. SOAP/WS-* and REST: Complementary Communication Styles
  17. The New Windows Threadpool
  18. The Perfect Pattern Storm, when TDD meets UX and MVP
  19. Understanding Software + Services
  20. Windows Server 2008 Kernel Architecture
  21. Windows Server 2008 Overview
  22. Windows Vista for Managed Developers: Besides .NET Framework 3.x

Comment » | Events

Disabling the WCF Service Host (WcfSvcHost.exe)

May 13th, 2008 — 10:28 am

One of the new and very annoying feature of Visual Studio 2008 is the WCF service host:

Windows Communication Foundation (WCF) Service Host (WcfSvcHost.exe) allows you to launch the Visual Studio debugger (F5) to automatically host and test a service you have implemented. The tool is integrated into Visual Studio through the WCF Service template and is invoked when you start to debug your project.

Sounds like a useful tool, right?

Well, if you don’t need this functionality, especially if you are used to VS 2005 WCF development, this can be incredibly annoying, more so since you can’t disable the darn thing.

Well, Dr. Nick comes to the rescue:

Simply look for this GUID and remove it from your csproj file (don’t forget to remove left over semicolon):

{3D9AD99F-2412-4246-B90B-4EAA41C64699}

Apparently the upcoming service pack for Visual Studio 2008 should include an easier way to disable the service host, so hopefully this solution is temporary.

Comment » | Visual Studio, WCF

Using 3rd party components for WPF applications

May 11th, 2008 — 02:55 am

I did a small review of available components suites for WPF. I focused mainly on grid and charting controls, as the nature of WPF allows customization of the UI in ways that previously required 3rd party components in a Winforms development:

Xceed:
Grid control only
Express edition - Free
Professional edition - 500$
With source code - 1250$

Infragistics:
Netadvantage for WPF
Includes DataGrid, Carousel controls, Ribbon, Chart, editor controls (masked edit, datetime picker, etc)
Price - 800$
Source code not included

Component One:
Studio for WPF
Includes DataGrid, Chart, Report viewer, Schedule controls (datetime picker, calendar, scheduler)
Price - 800$
Source code not included

Syncfusion:
Essential studio WPF edition
Includes Chart, Docking manager, Ribbon, Groupbar, Taskbar, Datetime editor, Autocomplete textbox, Font listbox, Color picker, numeric updown, masked edit, Tree view
Currently no grid is available
Price (with source) - 600$

As you can see, there aren’t many options available at the moment. What is worse is the fact most tools don’t come with a source control, meaning using them means taking a risk of losing support in the future.

My recommendation: Don’t purchase anything unless you absolutly need to. The only thing worth considering purchasing at the moment is a charting control (as there is none from Microsoft), but you should also consider an open-source solution.

Comment » | Tools, WPF