Fem*_*ref 6 batch-file visual-studio-2010 post-build
我目前有一个以下脚本作为项目的后期构建:
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"
Run Code Online (Sandbox Code Playgroud)
(它根据配置将x86或x64版本的程序集复制到输出文件夹)
这个脚本返回错误级别255,因为我不知道批处理脚本,有人能指出我的错误吗?
据我所知, IF批处理文件不支持将多个表达式ORing在一起的C语法.
因此,首先尝试更改脚本的第一行:
if $(ConfigurationName) == "Debug (x64)" || $(ConfigurationName) == "Release (x64)" (goto :x64)
if $(ConfigurationName) == "Debug" || $(ConfigurationName) == "Release" (goto :x86)
Run Code Online (Sandbox Code Playgroud)
至:
if "$(ConfigurationName)"=="Debug (x64)" goto :x64
if "$(ConfigurationName)"=="Release (x64)" goto :x64
if "$(ConfigurationName)"=="Debug" goto :x86
if "$(ConfigurationName)"=="Release" goto :x86
Run Code Online (Sandbox Code Playgroud)
还要注意附加"的$(ConfigurationName).
其余应该工作正常.
| 归档时间: |
|
| 查看次数: |
5036 次 |
| 最近记录: |