AspNetCompiler Task

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

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

The following table describes the parameters of the AspNetCompiler task.

ParameterDescription
AllowPartiallyTrustedCallersOptional Boolean parameter.

If this parameter is true,, the strong-name assembly will allow partially trusted callers.
CleanOptional 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.
DebugOptional 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.
DelaySignOptional Boolean parameter.

If this parameter is true, the assembly is not fully signed when created.
FixedNamesOptional Boolean parameter.

If this parameter is true, the compiled assemblies will be given fixed names..
ForceOptional 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.
KeyContainerOptional String parameter.

Specifies a strong name key container.
KeyFileOptional String parameter.

Specifies the physical path to the strong name key file..
MetabasePathOptional 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.
PhysicalPathOptional 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.
TargetFrameworkMonikerOptional String parameter.

Specifies the TargetFrameworkMoniker indicating which .NET Framework version of aspnet_compiler.exe should be used. Only accepts .NET Framework monikers.
TargetPathOptional String parameter.

Specifies the physical path to which the application is compiled. If not specified, the application is precompiled in-place.
UpdateableOptional 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.
VirtualPathOptional 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.

In addition to the parameters listed above, this task inherits parameters from the ToolTaskExtension class, which itself inherits from the ToolTask class. For a list of these additional parameters and their descriptions, see ToolTaskExtension Base Class.

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>  

Tasks
Task Reference

Show: