How to: Create a New WPF Browser Application Project

You can create a Windows Presentation Foundation (WPF) application which runs in a browser. This application model is named XAML Browser Application (XBAP). Creating an XBAP project is easy using the Visual Studio IDE.


The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To create a new WPF Browser Application project

  1. Start a version of Visual Studio that supports WPF development, such as Visual Studio 2008.

  2. On the File menu, point to New, and then select Project. The New Project dialog box appears.

  3. In the Project Types pane, choose the programming language you want to use.

  4. In the Templates pane, choose WPF Browser Application for Visual Basic or Visual C# projects. More information about the selected template is displayed below the Project Types and Templates panes.


    If you do not see the WPF Browser Application template, make sure that you are targeting a version of the .NET Framework that supports WPF. In the upper-right corner of the New Project dialog box, select .NET Framework 3.5 or later from the drop-down list.

  5. In the Name text box, name the project something unique to indicate the application's purpose.

  6. In the Location text box, enter the directory in which you want to save your project, or click the Browse button to navigate to it.

  7. Click OK. The Windows Presentation Foundation (WPF) Designer for Visual Studio opens, showing Page1.xaml of the project you created.

    Visual Basic noteVisual Basic Note:

    Every executable file that you create with Visual Basic 2005 contains a namespace with the same name as your project. For more information, see Namespaces in Visual Basic.

  8. On the Debug menu, and select Start Debugging.

    A browser window opens and displays the WPF browser application.


    If a message box appears warning you that script debugging is disabled, click Yes to continue debugging.

See Also


How to: Create a WPF UserControl Library Project

How to: Create a New WPF Application Project

How to: Create a C# WPF Application

Creating a Drawing Application by Using WPF

How to: Create a Sample Project File for a Windows Presentation Foundation XAML Browser Application

Safe File Upload from an XBAP Sample


Windows Presentation Foundation XAML Browser Applications Overview

Other Resources

WPF Designer