我正在服務器上部署一些文件。但是當我這樣做時,構建會刪除所有位於該位置的文件和文件夾。我不想從服務器上刪除所有文件。我想從目標文件夾中排除一個文件夾(文件夾名稱是Temp)。臨時文件夾在刪除其他文件時不應該被刪除。怎麼做?部署文件時出現MSBuild問題
這裏是TFS你爲什麼要使用複製任務構建定義
<PropertyGroup Condition=" '$(DeployEnvironment)' == 'Dev' ">
<DeployPath>\\server1\D$\temp\reports</DeployPath>
</PropertyGroup>
<Target Name="CoreCompileSolution" />
<Target Name="AfterCompile">
<Message Importance ="high" Text="Solution Root: $(SolutionRoot)" />
<Message Importance ="high" Text="Out Dir: $(OutDir)" />
<Copy SourceFiles="@(RPTFiles)" DestinationFolder="$(OutDir)_PublishedWebsites\Reports\" />
</Target>
<Target Name="AfterDropBuild" >
<CreateItem Exclude="$(DeployPath)\Temp*.*">
<Output ItemName="PreviousDeployment" TaskParameter="Include" />
</CreateItem>
</Target>
你好嗎部署這些文件?你是使用TFS構建定義,從Visual Studio發佈還是其他? – 2013-02-28 23:51:34
嗨,我正在使用TFS構建定義。這是相同的代碼。 – user2019295 2013-03-01 00:15:40