2011-02-02 11 views
8

Bir CruiseControl.net derleme ve dağıtımı komut dosyasında _WPPCopyWebApplication MSBuild hedefini kullanıyorum, ancak bu hedef uygulamadan önce projenin bir parçası olmayan dosyaları temizler. , App_Data dosyaları (bu uygulama için, yüklenen görüntüleri, vb.).MSBuild _WPPCopyWebApplication hedef temizlemeyi durdurma App_Data klasörü

Microsoft.Web.Publishing.targets;

<OnBefore_WPPCopyWebApplication> 
    $(OnBefore_WPPCopyWebApplication); 
    CleanWebProjectOutputDir; 
    PipelineTransformPhase; 
</OnBefore_WPPCopyWebApplication> 

Bu hedef göz önüne alınarak CleanWebProjectOutputDir'i nasıl durdurabilirim;

<Target Name="Deploy" DependsOnTargets="Tests"> 
    <MSBuild Projects="$(TargetPath)Website.csproj" Properties="Configuration=Debug;WebProjectOutputDir=\\servername\share;Outdir=$(ProjectDir)bin\;" Targets="ResolveReferences;_WPPCopyWebApplication" /> 
</Target> 

Bu, CC.Net altında yapılmış olsa da, bir VS2010 çözümdür; MSDeploy'dan haberdarım, fakat henüz tam olarak kafamı bulamadım, bu yüzden şimdilik MSBuild/_WPPCopyWebApplication ile uğraşmayı tercih ederim.

DÜZENLEME: daha da hedefin bu kısmına bu daralmış ettik

;

<!-- In the case of the incremental Packaging/Publish, we need to find out the extra file and delee them--> 
<ItemGroup> 
    <_AllExtraFilesUnderProjectOuputFolder Include="$(WebProjectOutputDir)\**" /> 
    <_AllExtraFilesUnderProjectOuputFolder Remove="@(FilesForPackagingFromProject->'$(WebProjectOutputDir)\%(DestinationRelativePath)')" /> 
</ItemGroup> 
<!--Remove all extra files in the temp folder that's not in the @(FilesForPackagingFromProject--> 
<Delete Files="@(_AllExtraFilesUnderProjectOuputFolder)" /> 

Ben de bu özel Sil görevi geçebilirim nasıl, soru olur sanırım, ya da en azından _AllExtraFilesUnderProjectOuputFolder istisnalar için ** App_data eklemek?

cevap

9

Özelliklerde CleanWebProjectOutputDir=False ekleyin:

<Target Name="Deploy" DependsOnTargets="Tests"> 
    <MSBuild Projects="$(TargetPath)Website.csproj" Properties="Configuration=Debug;CleanWebProjectOutputDir=False;WebProjectOutputDir=\\servername\share;Outdir=$(ProjectDir)bin\;" Targets="ResolveReferences;_WPPCopyWebApplication" /> 
</Target> 
+1

Tanrım, ben yaş için bu özellik için arıyordum nereye ben Msbuild özellikler listesini bulabilirsiniz biliyoruz? –