私は現在、ハッキングされたデプロイメントシステムをもう少しエレガントなもの(Octopus)で再調整することを検討しています。そうすることで、リリースビルドの実行時にVSにプロジェクトをパッケージ化させようとしています。この素晴らしいPowerShellスクリプトを作成して機能させていますが、msbuildスクリプトからEXECを実行しようとすると、VisualStudioがハングします。
最初は、シェルに物が逃げているのではないかと思ったのですが、ばかばかしく単純化したのですが、それでもフリーズします。
関連するMsBuildコードは次のとおりです。
<PropertyGroup>
<PowerShellExe Condition=" '$(PowerShellExe)'=='' ">
%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe
</PowerShellExe>
</PropertyGroup>
<Target Name="AfterBuild" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Exec Command="$(PowerShellExe) -NonInteractive -executionpolicy Unrestricted -command get-childitem" />
</Target>
それがすべきことは、ディレクトリリストを提供することだけです。cmd.exeからこれを呼び出すと正常に機能します。
C:\Users\smithj>%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -noninteractive -executionpolicy unrestricted -command dir
これを試してみてください:
msbuild Solution.sln /p:Configuration=Release
私にこれを取得します:
AfterBuild:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\\tf.exe" che
ckout Package.nuspec
Package.nuspec
%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe
-NonInteractive -executionpolicy Unrestricted -command dir
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
その後、それは永遠にハングします。どんな提案でも大歓迎です。