NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

URI Mapping and Name Resolution

Personal Tier maintains a local mapping of all installed applications and their URI namespaces to their local storage location. This allows the user to refer to remote applications using remote URIs, enables demand-driven installation of Personal Tier applications, and makes these URIs exportable to other installed Personal Tier applications. This mapping also notifies Microsoft Internet Explorer that these applications, though installed locally, originated at a remote location. Therefore, trust settings on the browser should be appropriate for the remote site, not for the local computer.

Once a user has installed a Personal Tier application from a Web site, when they return to the application URI, Personal Tier invokes the locally installed version. Even in this situation, however, the browser knows that it is running a remote application so that the application cannot access local resources.

When resolving names, Personal Tier searches the entire list of local mappings for the longest match. Once found, Personal Tier resolve the match to the application domain of the selected application and then calls the appropriate handler.

The following example demonstrates the Personal Tier URI mapping facility.

A user has two Personal Tier applications installed to their local computer as described in the following table.

Application Application URI Local Install Directory
Money myweb://www.Microsoft.com/money C:\money
Wingtiptoys myweb://www.wingtiptoys.com C:\program files\www.wingtiptoys.com

While applications can have arbitrary directory structures, for this example the directory structure of each application is:

approot
   bin\    # Business logic (various assemblies)
   img\   # images
   data\   # XML stores
   default.aspx
   config.cfg

Mapping works in the same way for either static or dynamic content. Applications can map using absolute or relatives URIs, or use virtual URIs to associate all requests for part of their URI namespace to a handler. The following table demonstrates file URIs and the physical file that Personal Tier maps them to.

URI Physical Path
myweb://www.Microsoft.com/money/ C:\money\default.aspx
myweb://www.Microsoft.com/money/img/dollar.jpg C:\money\img\dollar.jpg
myweb://www.wingtiptoys.com C:\program files\www.wingtiptoys.com\default.aspx
myweb://www.wingtiptoys.com/order.aspx C:\programfiles\www.wingtiptoys.com\order.aspx
CAUTION   For security reasons, there is a difference in how the Server.MapPath method works on the server and how it works in a locally run Personal Tier application. While the MapPath method returns the file system path for a resource, in Personal Tier it returns a path relative to the application's root directory. If an application tries to call Server.MapPath for a resource located outside of the application’s directory hierarchy, it will throw the SR.Cannot_map_path exception thrown in the server environment.

See Also

Personal Tier Architecture