Udostępnij za pośrednictwem


Advanced Precompile Settings Dialog Box

The Advanced Precompile Settings dialog box lets you specify how a web application is precompiled or assemblies are merged.

This topic applies to the following products:

To access this dialog

  1. In Visual Studio, open a web application project.

  2. Right click the project name in Solution Explorer and choose Properties (C#) or MyProject (Visual Basic) to display the Properties page.

  3. Choose the Package/Publish Web tab.

  4. In the Items to deploy (applies to all deployment methods) section, choose the Precompile this application before publishing option.

  5. Click Advanced.

    Advanced_Precompile_Settings_dialog_box

Uwaga

The settings that you enter in this dialog box are part of the settings that you enter on the Package/Publish Web tab. They apply only to the build configuration that is selected on the Package/Publish Web tab when you click the Advanced button.

UI Elements

For more information about the aspnet_compiler.exe options that the field definitions refer to, see ASP.NET Compilation Tool (Aspnet_compiler.exe) and ASP.NET Merge Tool (Aspnet_merge.exe).

  • Use IIS metabase path for source input
    This setting corresponds to the -m option of the aspnet_compiler.exe command. For example, a metabase path might be /IISExpress/7.5/LM/W3SVC/2/ROOT/MyWeb/, where MyWeb is the virtual directory.

    This setting is useful if your web site contains one or more sub-web sites. During compilation, the compiler processes all the files in a directory tree. If there are sub-web sites, this will result in build errors. To avoid these errors, you can specify the IIS metabase path of the web site you are compiling, which causes the ASP.NET compiler to skip any sub-web sites defined in the IIS metabase.

  • Allow precompiled site to be updatable
    This setting corresponds to the –u option of the aspnet_compiler.exe command.

    If you select this option, pages and user controls (.aspx, .ascx, and .master files) are copied as-is to the target folder and can be updated as text files without recompiling the project. Otherwise, the HTML markup for pages and user controls is removed and compiled into the assembly output.

  • Merge all outputs to a single assembly
    This setting is equivalent to the -o assemblyname option of the aspnet_merge.exe command.

  • Treat as library component (remove the App_Code.compiled file
    This setting corresponds to the -r option of the aspnet_merge.exe command.

    Selecting this option enables the project's App_Code.dll assembly to be added to the Bin folder of another web site without conflicting with the App_Code.dll assembly in the other web site. This is useful for building a library of .ascx controls

  • Merge each individual folder output to its own assembly
    This setting corresponds to the -prefix prefixname option of the aspnet_merge.exe command.

    This option enables you to update your web site at the folder level rather than updating the entire application. You can use the Optional assembly prefix box to specify a prefix that will be pre-pended to all generated assembly names. For example, if you specify the prefix MyCompany, the name becomes MyCompany.SubfolderName.

  • Merge all pages and control outputs to a single assembly
    This setting corresponds to the –w assemblyname option of the aspnet_merge.exe command.

    This option enables you to update UI elements separately from updating other code. Special folders such as App_Code, App_WebReferences, and so on are each compiled into a separate assembly. Specify the target assembly name in the Assembly name box.

  • Do not merge. Create a separate assembly for each page and control output
    This setting does not run aspnet_merge.exe. Instead, it uses the -fixednames option of the aspnet_compiler.exe command.

    This option is useful if you want to make granular updates of your deployed web site. However, compiling with the -fixednames option disables the compiler's batch optimizations and can result in longer compile times for large web sites.

  • Do not merge
    This setting does not run aspnet_merge.exe and does not use the -fixednames option of the aspnet_compiler.exe command.

See Also

Reference

Package/Publish Web Tab, Project Properties

Concepts

Web Application Project Deployment Overview for Visual Studio and ASP.NET