6

現在、プロジェクトのポストビルドとして次のスクリプトがあります。

if $(ConfigurationName) == "Debug (x64)" || $(ConfigurationName) == "Release (x64)" (goto :x64)
if $(ConfigurationName) == "Debug" || $(ConfigurationName) == "Release" (goto :x86)

:x64
copy "$(SolutionDir)References\x64\System.Data.SQLite.dll" "$(TargetDir)System.Data.SQLite.dll"
goto :default

:x86
copy "$(SolutionDir)References\System.Data.SQLite.dll" "$(TargetDir)System.Data.SQLite.dll"
goto :default

:default
copy "$(SolutionDir)References\System.Data.SQLite.Linq.dll" "$(TargetDir)System.Data.SQLite.Linq.dll"

(構成に従って、アセンブリのx86またはx64バージョンを出力フォルダーにコピーします)

このスクリプトはエラーレベル255を返しますが、バッチスクリプトがわからないので、誰かがエラーを指摘してもらえますか?

4

2 に答える 2

10

cmd.exeに、次のように入力しnet helpmsg 255ます。

拡張属性に一貫性がありません。

それが実際のエラーかどうかはわかりませんが、Win32エラーコードを解読するための便利な方法です。

于 2010-10-12T22:28:30.520 に答える
5

私の知る限り、 IFin batchファイルは、複数の式をOR演算する構文のようなCをサポートしていません。

したがって、最初の試行として、スクリプトのこれらの最初の行を次のように変更します。

if $(ConfigurationName) == "Debug (x64)" || $(ConfigurationName) == "Release (x64)" (goto :x64)
if $(ConfigurationName) == "Debug" || $(ConfigurationName) == "Release" (goto :x86)

に:

if "$(ConfigurationName)"=="Debug (x64)" goto :x64
if "$(ConfigurationName)"=="Release (x64)" goto :x64
if "$(ConfigurationName)"=="Debug" goto :x86
if "$(ConfigurationName)"=="Release" goto :x86

"また、の周りに追加されていることに注意してください$(ConfigurationName)
残りは正常に動作するはずです。

于 2010-10-12T22:43:02.453 に答える