All code files (stand-alone, code-behind, and designer class files) in the project are precompiled into a single assembly. By default, this assembly is built and persisted in the Bin folder. Because this compilation model creates a single assembly, you can specify attributes, such as assembly name and version. You can also specify the location of the output assembly. To change the location of the output assembly, in Solution Explorer, right-click the project name, click Properties, and then click the Build tab. On the Build tab is a field named Output Path where you can specify the path to the output assembly.
A Web application project is defined by a project file instead of by a project folder, as is done for a Web site project. The project file references the files that are included in the project, and includes the assembly references and other project metadata settings. Files that are in the project folder but that are not defined in the project file are not compiled as part of the Web application project. Project settings that are added and changed through Visual Studio or Visual Web Developer Express are referenced in the project file (.*proj) that is generated for each project.
To run and debug pages, you must compile the complete Web application project. However, building the complete Web application project can be fast because Visual Studio and Visual Web Developer Express use an incremental build model that builds only the files that have changed.
For more information, see ASP.NET Web Application Projects.
Compiling Class Files
Web application projects use MSBuild to compile class files. These class files are compiled into a single assembly. By default, they are put in the Bin folder. You can extend and customize the compilation process by using standard MSBuild extensibility rules. For more information, see MSBuild Overview.
The following table describes the types of Web application project class files that are compiled into a single assembly.
Class File Type | Description |
|---|
Standalone | Class files that you can create and add to the Bin folder. |
Code-behind | User-defined code that defines display and other behavior in ASP.NET Web pages. |
Designer | Code that is auto-generated. You should not modify the .designer file. |
Customizing Compilation Options
You can specify the output assembly name, version, and other details by using elements of the Application property page of the Project Designer window. Use the Build page in the Project Designer window to specify the project's build configuration. For example, you can specify how errors are handled and specify details about the assembly output. In addition, you can add pre-build and post-build steps during compilation by setting values of the Build Events property page. For more information about property pages, see Projects, User Interface Elements.