Verwenden von dirPath Provider mit WebDeploy

Ich habe eine in iis gehostete wcf-Anwendung, die ich mit webdeploy zu verpacken versuche. Alles funktioniert gut mit den Visual Studio-Tools, aber ich muss auch einen Protokollordner erstellen und Berechtigungen dafür festlegen. Zu diesem Zweck habe ich in meinem Webprojekt eine ProjectName.wpp.target-Datei erstellt. Die Datei sieht so aus

<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
<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>
lt;/Match> <Value>$(_DestinationContentPath)/log</Value> <ExcludeFromSetParameter>True</ExcludeFromSetParameter> </MsDeployDeclareParameters> </ItemGroup> </Target> </Project>

Ich kann sehen, dass der DirPath-Provider der Sourcemanifest-Datei hinzugefügt wird, aber wenn ich das Paket bereitstelle, versucht er, den Quelldateipfad zu erstellen. Im Wesentlichen ersetzt das Element LogsDirectoryPAth den Pfad nicht. Kann jemand darauf hinweisen, was ich tun muss? Vielen Dank !

Antworten auf die Frage(1)

Ihre Antwort auf die Frage