WPF: Pack URIs: what's the point of all the commas?

WPF uses “pack” URI schema to point to resources. An absolute pack URI looks like this:

pack://application:,,,/ResourceFile.xaml

The schema is described in this MSDN article and they claim the URIs are compatible with RFC 2396.

This is all fine and nice, but who invented these commas? They say it was supposed to be “application:///”, but you cannot put that many slashes in a valid URI, so they had to encode it. Why bother with the slashes at all?

pack://authority/path

would be a perfectly valid URI. E.g.

pack://application/ResourceFile.xaml

Whenever I see several commas in a row, I feel there are some missing parameters that could have been inserted there – thank you, VB. So, all these commas in URIs takes some getting used to.

Fortunately, relative URIs don’t require them, you can just say ResourceFile.xaml and it would work fine.

Leave a Reply

Your email address will not be published. Required fields are marked *