I'm trying to to add a post-build macro that would conditionally copy some files after the build if the configuration is not "Debug". I'm trying the following:
if ('$(ConfigurationName)' <> 'Debug')
copy /y $(ProjectDir)memcached.$(ConfigurationName).config
$(ProjectDir)memcached.config
And I get error 255. What should be the right syntax for the 'if' statement?
In the Post-build event command line box, specify the syntax of the build event. Add a call statement before all post-build commands that run . bat files. For example, call C:\MyFile.
Post-build event will only run when the compiler's output file (.exe or . dll) is different than the previous compiler output file. Thus, a post-build event is not run if a project is up-to-date.
Go to the Solution Explorer the right-click the project then select Properties then go to the Build Events tab. Now if you build the project based upon the selection of configuration name , the Web. config file will be updated.
Post build is used to update parts of the configuration after compile time and is typically used by the OEM. The post build parameters are located in a separate memory area which may be replaced by a new configuration that may be downloaded independently of the other parts for the ECU software.
Just figured out:
if not $(ConfigurationName) == Debug
copy /y $(ProjectDir)memcached.$(ConfigurationName).config
$(ProjectDir)memcached.config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With