Chúng ta có thể có một cái gì đó như thế này:VS2010: Liệu chúng tôi có thể có nhiều nếu trong sự kiện sau khi xây dựng?
if "Debug"=="$(ConfigurationName)"
(
goto :nocopy
)
else if "Release"=="$(ConfigurationName)"
(
del "$(TargetPath).config"
copy "$(ProjectDir)\App.Release.config" "$(TargetPath).config"
)
else if "ReleaseBeta"=="$(ConfigurationName)"
(
del "$(TargetPath).config"
copy "$(ProjectDir)\App.ReleaseBeta.config" "$(TargetPath).config"
)
else if "ReleaseProduction"=="$(ConfigurationName)"
(
del "$(TargetPath).config"
copy "$(ProjectDir)\App.ReleaseProduction.config" "$(TargetPath).config"
)
:nocopy
Tôi đã thử nó, nhưng nó không hoạt động. Mã lỗi là 255.