Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
MSBuild Reference
 AspNetCompiler Task
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework General Reference
AspNetCompiler Task

The AspNetCompiler task wraps aspnet_compiler.exe, a utility to precompile ASP.NET applications.

The following table describes the parameters of the AspNetCompiler task.

Parameter

Description

Clean

Optional Boolean parameter

If this parameter is true, the precompiled application will be built clean. Any previously compiled components will be recompiled. The default value is false. This parameter corresponds to the -c switch on aspnet_compiler.exe.

Debug

Optional Boolean parameter

If this parameter is true, debug information (.PDB file) is emitted during compilation. The default value is false. This parameter corresponds to the -d switch on aspnet_compiler.exe.

Force

Optional Boolean parameter

If this parameter is true, the task will overwrite the target directory if it already exists. Existing contents are lost. The default value is false. This parameter corresponds to the -f switch on aspnet_compiler.exe.

MetabasePath

Optional String parameter.

Specifies the full IIS metabase path of the application. This parameter cannot be combined with the VirtualPath or PhysicalPath parameters. This parameter corresponds to the -m switch on aspnet_compiler.exe.

PhysicalPath

Optional String parameter.

Specifies the physical path of the application to be compiled. If this parameter is missing, the IIS metabase is used to locate the application. This parameter corresponds to the -p switch on aspnet_compiler.exe.

TargetPath

Optional String parameter.

Specifies the physical path to which the application is compiled. If not specified, the application is precompiled in-place.

Timeout

Optional Int32 parameter.

Specifies the amount of time, in milliseconds, after which the task executable is terminated. The default value is Int.MaxValue, indicating that there is no time out period.

ToolPath

Optional String parameter.

Specifies the location from where the task will load the underlying executable file (aspnet_compiler.exe). If this parameter is not specified, the task uses the SDK installation path corresponding to the version of the framework that is running MSBuild.

Updateable

Optional Boolean parameter.

If this parameter is true, the precompiled application will be updateable. The default value is false. This parameter corresponds to the -u switch on aspnet_compiler.exe.

VirtualPath

Optional String parameter.

The virtual path of the application to be compiled. If PhysicalPath specified, the physical path is used to locate the application. Otherwise, the IIS metabase is used, and the application is assumed to be in the default site. This parameter corresponds to the -v switch on aspnet_compiler.exe.

The following code example uses the AspNetCompiler task to precompile an ASP.NET application.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="PrecompileWeb">
        <AspNetCompiler
            VirtualPath="/MyWebSite"
            PhysicalPath="c:\inetpub\wwwroot\MyWebSite\"
            TargetPath="c:\precompiledweb\MyWebSite\"
            Force="true"
            Debug="true"
        />
    </Target>
</Project>

Concepts

Other Resources

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Additional Task Parameters      Steven Nagy   |   Edit   |   Show History
Here are the additional parameters supported by this task that are not mentioned in the documentation above:

AllowPartiallyTrustedCallers

Optional Boolean parameter

If this parameter is true, specifies that the AllowPartiallyTrustedCallersAttribute, which allows partially trusted callers access to an assembly, should be applied to the strongly named assembly that Aspnet_compiler.exe generates.

DelaySign

Optional Boolean parameter

Specifies that the AssemblyDelaySignAttribute, which indicates that an assembly should be signed only with the public key token rather than with the public/private key pair, should be applied to the generated assembly.

This option must be combined with the KeyFile or KeyContainer parameter. If the attribute is already applied to the assembly in code files, Aspnet_compiler.exe throws an exception.

When you use the DelaySign parameter, the code produced by Aspnet_compilier.exe can run before the code is signed. You must ensure that the code is not vulnerable to malicious users before signing is completed.

FixedNames

Optional Boolean parameter

Specifies that one assembly should be generated for each page in the application. Each assembly is named with the virtual path of the original page unless the name would exceed the operating system limit for file names, in which case a hash is generated and used for the assembly name.

You cannot use the FixedNames parameter for in-place compilation; in-place compilation honors configuration settings for compilation batch mode.

KeyContainer

Optional String parameter

Specifies that the AssemblyKeyNameAttribute, which indicates the name of the container for the public/private key pair that is used to generate a strong name, should be applied to the compiled assembly.

This option must be combined with the AllowPartiallyTrustedCallers option. If the attribute is already applied to the assembly in code files, Aspnet_compiler.exe throws an exception.

KeyFile

Optional String parameter

Specifies that the AssemblyKeyFileAttribute, which indicates the name of the file containing the public/private key pair that is used to generate a strong name, should be applied to the compiled assembly.

Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker