Поделиться через


How to: Add New Project Items

Adding a project item is one way to extend the functionality of an application. Examples of project items include HTML pages, Class files, Web Services, ASP.NET pages, Dataset files, and Style sheets.

The kinds of files that you can add to a project are determined by the project template that was used to create it, and by the version of the .NET Framework targeted by the project. For example, you can add a new .vb file to a project created by using a Visual Basic project template. However, you cannot add a new .vb file to a project created by using a Visual C++ project template. Also, item templates designed for a later version of the .NET Framework do not appear in the templates list for projects that target earlier versions.

Note

If your anti-virus software displays a message that offers to block script that the project template or wizard is running, choose not to block script. If script is blocked, then Visual Studio may close. You can prevent this condition by clearing the anti-virus software setting for blocking script. However, changing this setting disables all script blocking.

To add a new project item

  1. In Solution Explorer, select a target project.

  2. On the Project menu, click Add New Item.

  3. In the Category pane, select a category.

    Note

    If only one category exists, this dialog box only contains the Templates pane.

  4. In the Templates pane, select an item template.

  5. Click Open.

See Also

Tasks

How to: Remove, Delete, and Exclude Items

How to: Add and Remove Solution Items

Reference

File Types and File Extensions in Visual Studio

Concepts

Using Solution Explorer

Item Management in Projects

Introduction to Solutions, Projects, and Items

Other Resources

Managing Solutions, Projects, and Files