Dela via


Application Page, Project Designer (C#)

Use the Application page of the Project Designer to specify the project's application settings and properties.

To access the Application page, select a project node in Solution Explorer, and then, on the Project menu, click Properties. When the Project Designer appears, click the Application tab.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

General Application Settings

The following options enable you to configure general settings for the application.

  • Assembly name
    Specifies the name of the output file that will hold the assembly manifest. Changing this property will also change the Output Name property. You can also make this change from the command line by using /out (C# Compiler Options). To access this property programmatically, see AssemblyName.

  • Default namespace
    Specifies the base namespace for files added to the project.

    See namespace (C# Reference) for more information about creating namespaces in your code.

    To access this property programmatically, see RootNamespace.

  • Target Framework
    Specifies the version of the .NET Framework, or its profile, that the application targets. This option can have different values depending on which versions of the .NET Framework and which profiles are installed on your computer.

    An example of a .NET Framework profile is a client profile that represents a subset of the .NET Framework libraries and features that can be used to create client applications. For more information, see .NET Framework Client Profile.

    By default, the value is the same as the target framework that you selected in the New Project dialog box.

    Note

    The prerequisite packages listed in the Prerequisites Dialog Box are set automatically the first time that you open the dialog box. If you subsequently change the project's target framework, you will have to select the prerequisites manually to match the new target framework.

    For more information, see How to: Target a Specific .NET Framework Version or Profile and Visual Studio Multi-Targeting Overview.

  • Output type
    Specifies the type of application to build. The options are as follows:

    • Windows Application

    • Console Application

    • Class Library

    In a Web Application project, this property can be set only to Class Library. See /target (C# Compiler Options) for more information.

    In a WPF Browser Application project, this option is disabled.

    To access this property programmatically, see OutputType.

  • Assembly Information
    Clicking this button displays the Assembly Information Dialog Box.

  • Startup object
    Defines the entry point to be called when the application loads. Generally this is set either to the main form in your application or to the Main procedure that should run when the application starts. Because class libraries do not have an entry point, their only option for this property is (Not Set).

    By default, in a WPF Browser Application project, this option is (Not set). The other option is Projectname.App. In this kind of project, you have to set the startup URI to load a UI resource when the application starts. To do this, open the Application.xaml file in your project and set the StartupUri property to a .xaml file in your project, such as Window1.xaml. For a list of acceptable root elements, see StartupUri. You also have to define a public static void Main() method in a class in the project. This class will appear in the Startup object list as ProjectName.ClassName. You can then select the class as the startup object.

    See /main (C# Compiler Options) for more information. To access this property programmatically, see StartupObject.

Resources

The following options enable you to configure general settings for the application.

  • Icon and manifest
    By default, this radio button is selected and the Icon and Manifest options are enabled. This enables you to select your own icon, or to select different manifest generation options. Leave this radio button selected unless you are providing a resource file for the project.

  • Icon
    Sets the .ico file that you want to use as your program icon. Click the ellipsis button to browse for an existing graphic, or type the name of the file that you want. See /win32icon (C# Compiler Options) for more information. To access this property programmatically, see ApplicationIcon.

  • Manifest
    Selects a manifest generation option when the application runs on Windows Vista under User Account Control (UAC). This option can have the following values:

    • Embed manifest with default settings. Supports the typical manner in which Visual Studio operates on Windows Vista, which is to embed security information in the application's executable file, specifying that requestedExecutionLevel be AsInvoker. This is the default option.

    • Create application without a manifest. This method is known as virtualization. Use this option for compatibility with earlier applications.

    • Properties\app.manifest. This option is required for applications deployed by ClickOnce or Registration-Free COM. If you publish an application by using ClickOnce deployment, Manifest is automatically set to this option.

  • Resource File
    Select this radio button when you are providing a resource file for the project. Selecting this option disables the Icon and Manifest options.

    Enter a path name or use the Browse button (...) to add a Win32 resource file to the project.

See Also

Tasks

How to: Specify Assembly Information (Visual Basic, C#)

How to: Change an Assembly Name (Visual Basic, C#)

How to: Change the Application Type (Visual Basic, C#)

How to: Specify an Application Icon (Visual Basic, C#)

Concepts

Namespace Considerations in Office Solutions

Other Resources

Managing Application Properties