MSBuild를 사용하는 것이 좋습니다. 그러나 고아가 된 파일 (.csproj에없는 .cs 파일)이 있으면 aspnet_compile.exe가 실패하는 경우가 있습니다. 이 문제를 해결하기 위해 .csproj에 포함되지 않은 모든 * .cs 파일을 제거하기 위해 다음을 작성했습니다. 지금까지 그렇게 좋았습니다. 어떤 의견이라도 감사합니다.
<project>
<foreach item="File" property="csprojFile">
<in>
<items>
<include name="source/**/*.csproj" />
</items>
</in>
<do>
<property name="currentFolder" value="${directory::get-current-directory()}" />
<property name="csprojParentFolder" value="${directory::get-parent-directory(csprojFile)}" />
<foreach item="File" property="csFile">
<in>
<items>
<include name="${csprojParentFolder}/**/*.cs"/>
</items>
</in>
<do>
<property name="csFileRelativePath" value="${string::replace(csFile, csprojParentFolder + '\', '')}" />
<loadfile property="projFile" file="${csprojFile}" />
<if test="${not string::contains(projFile, csFileRelativePath)}">
<echo message="${csprojFile}: | Missing: ${csFileRelativePath}" />
<!-- <delete file="${csprojParentFolder + '\' + csFileRelativePath}" /> -->
</if>
</do>
</foreach>
</do>
</foreach>
</project>
그게 정확히 우리가하는 방법입니다. Lee와 같은'exec' 태스크를 통해 MSBuild를 호출하면 좋겠지 만 nantcotrib의'msbuild' 태스크를 사용하면 훨씬 더 편합니다. –
고마워요, msbuild 확실히가는 길. 내 빌드 파일은 현재 크기의 1/4 정도입니다. –
xbuild (.sln)로 ProtoBuf 포트를 빌드 해 보았습니다. 괜찮습니다. – radical