Visual Studio ® 2008: Windows ® Presentation Foundation
Visual Studio® 2008: Windows® Presentation
Foundation
Module 9: Configuring and Deploying Applications in Windows Presentation Foundation
• Deployment Options
• Deploying a Stand-Alone WPF Application
• Deploying an XBAP Application
• Configuring Manifest Settings
Lesson: Deployment Options
• Deployment Technologies
• Full-Trust and Partial-Trust Applications
• WPF Features Available in Partial Trust
• WPF Features Unavailable in Partial Trust
• XBAP Applications on the Local Intranet
Deployment Technologies
• XCopy deployment
• Microsoft Windows Installer
• ClickOnce deployment
• Windows Remote Desktop Connection
Full-Trust and Partial-Trust Applications
RegistryRegistry
WPFApplication
WPFApplication
DNS DatabaseDNS Database
Web ServicesWeb Services
Environment Variables
Environment Variables
SQL ServerSQL Server
OLEDB Data Source
OLEDB Data Source
File SystemFile System
Windows Event Log
Windows Event Log
Unmanaged CodeUnmanaged Code
EnvironmentPermissionEnvironmentPermission
Remote ServersRemote Servers
SecurityPermission.UnmanagedCode
SecurityPermission.UnmanagedCode
WebPermissionWebPermission
DNSPermissionDNSPermission
RegistryPermissionRegistryPermission
SqlClientPermissionSqlClientPermission
SocketsPermissionSocketsPermission
FileIOPermissionFileIOPermission
OleDbClientPermissionOleDbClientPermissionEventLogPermissionEventLogPermission
WPF Features Available in Partial Trust
• General features
Browser window, isolated storage, commands, and simulated drag and drop
• Web integration
Browser download dialog box, top-level navigation, HTTP Web requests, E-mail links, and ASMX Web services
• Visual effects
2-D and 3-D graphics, animation, media, audio, and video
• Reading
Flow documents, XPS documents, embedded fonts, system fonts, and TrueType fonts
• Editing
Spelling checker and copy and paste
WPF Features Unavailable in Partial Trust
• General features
Application-defined windows and dialog boxes, file system access, registry access, and Windows Forms interoperability
• Web integration
Scripting and access to the Document Object Model
• Visual effects
Bitmap effects and image encoding
• Editing
Access to the Rich Text Format (RTF) clipboard and full XAML support
XBAP Applications on the Local Intranet
By default, XBAP applications run with partial trust:
• Default Internet zone permission set
If you launch an XBAP application from the local intranet:
• The XBAP application can take advantage of the LocalIntranet permission set
LocalIntranet permissions grant access to additional resources:
• DNS
• Environment variables
• File dialogs
• Isolated storage
• Printing
• Reflection
• Security
• User interface
Lesson:Deploying a Stand-Alone WPF Application
• Deploying a Stand-Alone Application by Using Windows Installer
• Deploying a Stand-Alone Application by Using ClickOnce
• Installing the .NET Framework
Deploying a Stand-Alone Application by Using Windows Installer
To create a Windows Installer Setup project:
1. Add a Setup project to your solution
2. Configure your application as an output project
3. Configure the properties of the setup project
4. Add any additional files
5. Build the project
6. Distribute the .msi file
Deploying a Stand-Alone Application by Using ClickOnce
To create a ClickOnce deployment:
1. Select the project that you want to deploy
2. On the Build menu, click Publish
3. Follow the steps in the Publish Wizard
4. Distribute the published location
Installing the .NET Framework
To run a WPF application, the Microsoft .NET Framework 3.0 must be installed on the client computer
For WPF browser-hosted applications launched from Windows Internet Explorer 7:
• If .NET Framework is installed, Internet Explorer detects it
• If .NET Framework is not installed, Internet Explorer downloads it and installs it
Lesson: Deploying an XBAP Application
• XBAP Files That Must Be Deployed
• What Is a Manifest File?
• Publishing an XBAP Application to a Web Server
• Installing an XBAP Application to a Client Computer
XBAP Files That Must Be Deployed
An XBAP is a compiled application that requires at least the following three files to be deployed:
• ApplicationName.exe
• ApplicationName.xbap
• ApplicationName.exe.manifest
What Is a Manifest File?
An application manifest file describes:
• Application assemblies
• Dependent assemblies
• Permissions that are required by the application
A deployment manifest file describes the deployment model:
• Location
• Current version
• Update behavior
• Publisher identity
• Digital signature
Publishing an XBAP Application to a Web Server
To deploy an XBAP by using ClickOnce deployment:
1. Select the project you want to deploy
2. On the Build menu, click Publish
3. Follow the steps in the Publish Wizard
4. Distribute the published location
To deploy an XBAP by using XCopy deployment:
1. Build the application
2. Copy the output files to the target Web server
Installing an XBAP Application to a Client Computer
To deploy an XBAP by using XCopy deployment:
1. Build the application
2. Copy the output files to the target client computer
To deploy an XBAP by using Windows Installer:
1. Add a Setup project to your solution
2. Configure your application as an output project
3. Configure the properties of the Setup project
4. Add any additional files
5. Build the project and distribute the .msi file
Lesson: Configuring Manifest Settings
• Using the Manifest Generation and Editing Tools
• Mage.exe Commands
• Setting Options for New and Updated Files
• Setting Options for Signing Files
Using the Manifest Generation and Editing Tools
You can use the manifest generation and editing tools to create and edit manifest files
• Mage.exe is a command-line tool
• MageUI.exe is an equivalent graphical tool
You can use Mage.exe and MageUI.exe to set:
• Common properties in deployment and application manifests
• Application manifest properties
• Deployment manifest properties
Mage.exe Commands
• -New
Create a new deployment or application manifest file
• -Update
Make changes to a manifest file
• -Sign
Sign a manifest file by using a certificate
• -Help
Describes all the available commands and their options
Mage.exe syntax:
Mage [commands] [commandOptions]Mage [commands] [commandOptions]
Setting Options for New and Updated Files
Common options for new and updated application and deployment manifest files:
• CertFile and CertHash
• Name and Password
• ToFile, Processor, and Version
Options for new and updated application manifest files:
• FromDirectory
• TrustLevel
Options for new and updated deployment manifest files:
• AppCodeBase and AppManifest
• Install, MinVersion, and ProviderUrl
Setting Options for Signing Files
Specify the following options when you sign a manifest file:
• CertFile and CertHash
• Password
• ToFile
Lab: Configuring and Deploying WPF Applications
• Exercise 1: Deploying a Stand-Alone WPF Application
• Exercise 2: Updating a Deployment Manifest
• Exercise 3: Deploying an XBAP Application
Logon information
Virtual machine 6460A-LON-DEV-09
User name Student
Password Pa$$w0rd
Estimated time: 60 minutes
Lab Review
• What type of project must you create to deploy a stand-alone application by using Windows Installer?
• What is the name of the tool that you use to create and manipulate both deployment and application manifest files?
• What three files are the minimum that is required to manually deploy an XBAP?
• What is the name of the technology that is used to publish XBAP applications when using Visual Studio?
Module Review and Takeaways
• Review Questions
• Best Practices
• Tools
Course Evaluation