Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
The AspNetCompiler task wraps aspnet_compiler.exe, a utility to precompile ASP.NET applications.
Task parameters
The following table describes the parameters of the AspNetCompiler task.
| Parameter | Description | 
|---|---|
| AllowPartiallyTrustedCallers | Optional Booleanparameter.If this parameter is true, the strong-name assembly will allow partially trusted callers. | 
| Clean | Optional BooleanparameterIf this parameter is true, the precompiled application will be built clean. Any previously compiled components will be recompiled. The default value isfalse. This parameter corresponds to the -c switch on aspnet_compiler.exe. | 
| Debug | Optional Booleanparameter.If this parameter is true, debug information (.PDB file) is emitted during compilation. The default value isfalse. This parameter corresponds to the -d switch on aspnet_compiler.exe. | 
| DelaySign | Optional Booleanparameter.If this parameter is true, the assembly is not fully signed when created. | 
| FixedNames | Optional Booleanparameter.If this parameter is true, the compiled assemblies will be given fixed names.. | 
| Force | Optional BooleanparameterIf this parameter is true, the task will overwrite the target directory if it already exists. Existing contents are lost. The default value isfalse. This parameter corresponds to the -f switch on aspnet_compiler.exe. | 
| KeyContainer | Optional Stringparameter.Specifies a strong name key container. | 
| KeyFile | Optional Stringparameter.Specifies the physical path to the strong name key file.. | 
| MetabasePath | Optional Stringparameter.Specifies the full IIS metabase path of the application. This parameter cannot be combined with the VirtualPathorPhysicalPathparameters. This parameter corresponds to the -m switch on aspnet_compiler.exe. | 
| PhysicalPath | Optional Stringparameter.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. | 
| TargetFrameworkMoniker | Optional Stringparameter.Specifies the TargetFrameworkMoniker indicating which .NET Framework version of aspnet_compiler.exe should be used. Only accepts .NET Framework monikers. | 
| TargetPath | Optional Stringparameter.Specifies the physical path to which the application is compiled. If not specified, the application is precompiled in-place. | 
| Updateable | Optional Booleanparameter.If this parameter is true, the precompiled application will be updateable.  The default value isfalse. This parameter corresponds to the -u switch on aspnet_compiler.exe. | 
| VirtualPath | Optional Stringparameter.The virtual path of the application to be compiled. If PhysicalPathspecified, 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. | 
ToolTaskExtension parameters
This task inherits from the ToolTaskExtension class, which inherits from the ToolTask class, which itself inherits from the Task class. This inheritance chain adds several parameters to the tasks that derive from them.
The following table describes the parameters of the base classes:
| Parameter | Description | 
|---|---|
| EchoOff | Optional boolparameter.When set to true, this task passes /Q to the cmd.exe command line such that the command line does not get copied to stdout. | 
| EnvironmentVariables | Optional Stringarray parameter.Array of environment variable definitions, separated by semicolons. Each definition should specify an environment variable name and value separated by an equal sign. These variables are passed to the spawned executable in addition to, or selectively overriding, the regular environment block. For example, Variable1=Value1;Variable2=Value2. | 
| ExitCode | Optional Int32output read-only parameter.Specifies the exit code that is provided by the executed command. If the task logged any errors, but the process had an exit code of 0 (success), this is set to -1. | 
| LogStandardErrorAsError | Optional boolparameter.If true, all messages received on the standard error stream are logged as errors. | 
| StandardErrorImportance | Optional Stringparameter.Importance with which to log text from the standard error stream. | 
| StandardOutputImportance | Optional Stringparameter.Importance with which to log text from the standard out stream. | 
| Timeout | Optional Int32parameter.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. Time-out is in milliseconds. | 
| ToolExe | Optional stringparameter.Projects may implement this to override a ToolName. Tasks may override this to preserve the ToolName. | 
| ToolPath | Optional stringparameter.Specifies the location from where the task loads the underlying executable file. If this parameter is not specified, the task uses the SDK installation path that corresponds to the version of the framework that is running MSBuild. | 
| UseCommandProcessor | Optional boolparameter.When set to true, this task creates a batch file for the command line and executes it by using the command-processor instead of executing the command directly. | 
| YieldDuringToolExecution | Optional boolparameter.When set to true, this task yields the node when its task is executing. | 
Example
The following code example uses the AspNetCompiler task to precompile an ASP.NET application.
<Project>
    <Target Name="PrecompileWeb">
        <AspNetCompiler
            VirtualPath="/MyWebSite"
            PhysicalPath="c:\inetpub\wwwroot\MyWebSite\"
            TargetPath="c:\precompiledweb\MyWebSite\"
            Force="true"
            Debug="true"
        />
    </Target>
</Project>