Home > WPF > URIs in Windows Presentation Foundation

URIs in Windows Presentation Foundation

It seems that understanding and using uniform resource identifiers (URI) is essential in WPF. After searching web and MSDN help I found following articles useful:


With a bit of simplification, I can describe the URI as a new method for identifying the relative or absolute location of a file.

The key element of the URI is the package scheme.  which represent the logical path of a content. It contains two parts Authority and Path.


WPF supports two authorities:

  • application:///
  • siteoforigin:///


MSDN: “The application:/// authority identifies application data files that are known at compile time, including resource and content files. The siteoforigin:/// authority identifies site of origin files.”

I found that Application authority is adequate in majority of cases including  accessing a file or a resource from the local or referenced assembly.

Important: to conform to RFC 2396, the “/” character must be replaced with the “,” character and other reserved characters must be escaped including “%” and “?”

Following examples shows pack URI for different scenarios:

Resource file – local assembly



Resource file in subfolder – local assembly



Resource file – referenced assembly



Resource file in subfolder of referenced assembly



Resource file in versioned referenced assembly



Content file



Content file in subfolder



Site of origin file



Site of origin file in subfolder


Categories: WPF

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: