I have two projects, that use the same code in the same location, but use different dependencies and app.config files, and both projects compile to the same exe name.
Currently, I have a PreBuild script configured, that copies the correct file from project_a.config
or project_b.config
to app.config
.
Unfortunately, XBuild does not execute the PreBuild scripts when running from command line, so I have to do the copying before building.
Is there a way to use another file as app.config?
EDIT: Note, that this is only running on Linux.
The entry in my csproj file:
<Command type="BeforeBuild"
command="cp -f MonoMultiJack.Linux.config app.config"
workingdir="${ProjectDir}" />
And this is my build script:
#!/bin/bash
XBUILD=xbuild
SOLUTION=MonoMultiJack.Lnx.sln
# do some other stuff
${XBUILD} ${SOLUTION} /p:Configuration=Release /t:Clean
${XBUILD} ${SOLUTION} /p:Configuration=Release