问题
I tried to use:
<Exec Command="pause" />
But that doesn't work. Please help to to pause!
Nam.
回答1:
The MSBuild Community Tasks has a Prompt task that sounds like it will work for you. I've never used it myself, so can't say from experience.
回答2:
I've tried Prompt task with an sample script as below. It works. Thank you! Nam.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="MAIN" >
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<Target Name="MAIN">
<MSBuild.Community.Tasks.Prompt Text="Press any key..." >
<Output TaskParameter="UserInput" PropertyName="out" />
</MSBuild.Community.Tasks.Prompt>
</Target>
</Project>
来源:https://stackoverflow.com/questions/2542672/how-can-i-pause-in-the-middle-of-the-execution-of-a-msbuild-script