문제
MSBuild가 내 솔루션을 구축 한 후 (ASP.NET 웹 사이트와 함께) WebDeployment Project가 웹 사이트를 디렉토리 _publishedwebsites에 구축하고 배치했습니다.
C : MyBuilds buildName Daily_20090519.3 Release_Publishedwebsites MyWebsite.
IIS가 테스트 웹 사이트를 가리키는 고정 디렉토리에 이것을 어떻게 복사합니까?
많은 코드 스 니펫을 발견했지만이 디렉토리 이름이 변경되었다는 사실을 고려할 것 같지는 않습니다.
해결책
이것은 매우 쉽습니다. 프로젝트를 편집하고 다음과 비슷한 것을 삽입 할 수 있습니다.
<PropertyGroup>
<OutputDest>$(MSBuildProjectDirectory)\..\OutputCopy\</OutputDest>
</PropertyGroup>
<Target Name="AfterBuild">
<!-- Create an item with all the output files -->
<ItemGroup>
<_OutputFiles Include="$(OutputPath)**\*" Exclude="$(OutputPath)obj\**\*" />
</ItemGroup>
<!-- You probably don't want to include the files in the obj folder so exclude them. -->
<Message Text="OutputDest : $(OutputDest)" />
<Copy SourceFiles="@(_OutputFiles)"
DestinationFiles="@(_OutputFiles->'$(OutputDest)%(RecursiveDir)%(Filename)%(Extension)')"/>
</Target>
이것이 당신이 찾고있는 것입니까?
다른 팁
다른 기술을 사용하고 있습니다.
<PropertyGroup>
<BinariesRoot>c:\BinariesForIis\</BinariesRoot>
</PropertyGroup>
그만큼 c:\BinariesForIis\
직접 출력 컴파일 바이너리에 사용됩니다 (사본 전 ...\Daily_20090519.3\Release_
...).
제휴하지 않습니다 StackOverflow