下表列出 Web Deployment 项目中包含的 MSBuild 任务,也就是说,Web Deployment 能做哪些事:
任务 | 描述 |
ReplaceConfigSections | Replaces a section in the Web.config file with the matching section from an external (.config) file. |
CreateVirtualDirectory | Creates an IIS virtual directory. |
AspNetCompiler | Calls aspnet_compiler.exe. |
AspNetMerge | Calls aspnet_merge.exe. |
GrantServerAccess | Grants ASP.NET read or write access to specific folders. |
ToggleDebugCompilation | Changes the value of compilation debug setting in the Web.config file. |
GenerateAssemblyInfo | Generates an assembly with the assembly attributes defined in the AssemblyAttributes MSBuild item. |
下表列出 Web Deployment 项目中包含的 MSBuild 属性:
属性 | 描述 |
EnableCopyBeforeBuild | Makes a copy of the Web site before running aspnet_compiler.exe. This is useful for modifying files before they are compiled. |
CopyBeforeBuildTargetPath | Specifies the folder where the copied Web site should be placed. |
SourceWebPhysicalPath | Specifies the path to the Web site being compiled. |
EnableUpdateable | Enables the Web site to be updatable. |
AllowPartiallyTrustedCallers | Allows partially trusted callers. |
DeleteAppDataFolder | Deletes the App_Data folder in the precompiled Web site. |
UseMerge | When true, causes the AspNetMerge target to execute. |
AssemblyPrefixName | Specifies the prefix for merged assemblies. |
SingleAssemblyName | Specifies the assembly name used when merging into a single assembly. |
ContentAssemblyName | Specifies the assembly name used when merging into a separate content assembly. |
MergeErrorStack | Adds error stack trace information to the build output. |
DeleteAppCodeCompiledFiles | Deletes the App_Code.compiled file. |
CopyAssemblyAttributes | Specifies that aspnet_merge.exe should copy the assembly attributes from the App_Code assembly into the merged assemblies. |
AssemblyInfoDll | Specifies an alternate DLL containing the assembly attributes that aspnet_merge.exe should use. |
MergeXmlDocs | Merge the xml documentation files associated with the assemblies compiled by the aspnet_compiler.exe. This is equivalent to the -xmldocs argument of aspnet_merge.exe. |
MergeErrorLogFile | Specifies an alternate log file for the merge process. |
UseWebConfigReplacement | When true, causes the ReplaceWebConfigSections target to execute. |
UseExernalWebConfigReplacementFile | Specifies whether replaced sections will use the configSource file reference. If false, the section is replaced in place. |
ValidateWebConfigReplacement | Validates that the Web.config file section being replaced has the same number of elements as the replacement section. |
VirtualDirectoryAlias | Specifies the alias for the virtual directory that is created for the precompiled build output. |
VirtualDirectoryServer | Specifies the server on which to create the virtual directory. The default is 1. |
ReplaceExistingVirtualDirectory | Replaces the existing virtual directory. If false, the build will fail if the path of the existing virtual directory in the IIS metabase does not match the path of the precompiled Web site. |
下表列出 Web Deployment 项目中包含的MSBuild 项:
项 | 描述 |
ExcludeFromBuild | Files to exclude from a build. |
WebConfigReplacementFiles | Sections to replace in the Web.config file. |
AssemblyAttributes | Assembly attributes to apply to merged assemblies. |
PrecompiledOutput | All output files from the AspNetCompiler or AspNetMerge targets. |
下表列出 Web Deployment 项目中包含的 MSBuild 目标:
目标 | 描述 |
Clean | Executes when performing a complete build. |
Rebuild | Executes when rebuilding. |
AspNetCompiler | Invokes the AspNetCompiler task. |
AspNetMerge | Invokes the AspNetMerge task. |
ReplaceWebConfigSections | Invokes the ReplaceConfigSections task. |
CreateVirtualDirectory | Invokes the CreateVirtualDirectory task. |
BuiltProjectOutputGroup | Populates the project output group. |
GenerateAssemblyInfo | Invokes the GenerateAssemblyInfo task. |
BeforeBuild | Specifies an override for the BeforeBuild target. |
BeforeMerge | Specifies an override for the BeforeMerge target. |
AfterMerge | Specifies an override for the AfterMerge target. |
AfterBuild | Specifies an override for the AfterBuild target. |