【发布时间】:2012-10-11 22:54:38
【问题描述】:
我有一个托管在 iis 中的 wcf 应用程序,我正在尝试使用 webdeploy 进行打包。一切都适用于 Visual Studio 工具,但我还需要创建一个日志文件夹并设置权限。为此,我在我的 Web 项目中创建了一个 ProjectName.wpp.target 文件。 文件是这样的
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="CreateLogsDirectory" AfterTargets="AddIisSettingAndFileContentsToSourceManifest">
<!-- This must be declared inside of a target because the property
$(_MSDeployDirPath_FullPath) will not be defined at that time. -->
<ItemGroup>
<MsDeploySourceManifest Include="dirPath">
<Path>$(_MSDeployDirPath_FullPath)\logs</Path>
<enableRule>DoNotDeleteRule</enableRule>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
<Target Name="DeclareCustomParameters" AfterTargets="AddIisAndContentDeclareParametersItems">
<!-- This must be declared inside of a target because the property
$(_EscapeRegEx_MSDeployDirPath) will not be defined at that time. -->
<ItemGroup>
<MsDeployDeclareParameters Include="LogsDirectoryPath">
<Kind>ProviderPath</Kind>
<Scope>dirPath</Scope>
<Match>^$(_EscapeRegEx_MSDeployDirPath)\\logs$</Match>
<Value>$(_DestinationContentPath)/log</Value>
<ExcludeFromSetParameter>True</ExcludeFromSetParameter>
</MsDeployDeclareParameters>
</ItemGroup>
</Target>
</Project>
我可以看到 dirPath 提供程序已添加到 sourcemanifest 文件中,但是当我部署包时,它会尝试创建源文件路径。本质上,LogsDirectoryPAth 项目并没有替换路径。有人可以指出我需要做什么吗?谢谢!
【问题讨论】:
标签: msbuild msdeploy webdeploy