Configure and Deploy WPF Applications

Posted on

These questions are based on 70-502 CSHP – TS – Microsoft .NET Framework 3.5: Windows Presentation Foundation (C# .NET)
Microsoft
Self Test Software Practice Test

Objective: Configure and deploy WPF applications.
Sub-objective: Deploy to a partial trust environment.

Single answer, multiple-choice

You are developing an XAML Browser Application (XBAP) using the Microsoft .NET Framework 3.5. The application includes a non-compiled data file named copyright_notice.xaml.

You want to add a hyperlink that points to the file copyright_notice.xaml without generating a security exception. Which Extensible Application Markup Language (XAML) should you use?

  1.  Copyright Notice
  2.  Copyright Notice
  3.  Copyright Notice
  4.  Copyright Notice

Answer:

  1.  Copyright Notice

Tutorial:
To access an application data file in a partial trust environment, you must navigate to the file as a site of origin. Site of origin files are the only option to access application data files in a partial trust environment for XBAPs. The following Pack URI syntax for a site of origin file is as follows:

pack://siteoforigin:,,,/Datafile

The Pack URI scheme is based on the Open Packaging Conventions (OPC) specification to make content available through a URI hierarchy. Pack URIs consists of a protocol, authority and path in the following syntax:

pack://authority:,,,/path

Windows Presentation Foundation (WPF) includes two authorities: application and siteoforigin. The application authority includes resource and content files, while the siteoforigin authority is intended for files outside an assembly or its references. Files known at compile time use the application authority, and files available only at run time use the siteoforigin authority. Absolute URIs specify the authority, while relative references assume the application authority.

You cannot use any URI other than site of origin files in a partial-trust environment. You can use site of origin files in other environments, but site of origin files are the only option for data files in a partial trust environment. You can use file, HTTP and application authority pack URIs in a full-trust environment only.

Reference:
MSDN2 Library > .NET Framework 3.5 > Windows Presentation Foundation > Application Development > Application Management > Pack URIs in Windows Presentation Foundation

Like what you see? Share it.Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone
cmadmin

ABOUT THE AUTHOR

Posted in Archive|

Comment: