-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
From @loop-evgeny on February 2, 2018 17:12
I have a config file in my project (instance.config) that I want copied to the output directory, so it's set to "Copy if newer". This config file is not checked into source control, but there is a file (instance.config.template), which gets copied to instance.config if that doesn't already exist. This all works, but not in the same build: the first build copies instance.config to the source directory and only the next build copies it to the output. As it's the pre-build step, I would expect any files it generates to be treated like any other source files, so in this case, instance.config should be copied to the output by the first build after a clean checkout.
CopySourceFileInPreBuild.zip reproduces the problem.
I even tried getting the pre-build step to modify another source file, but that doesn't help.
A workaround is to create a post-build step to copy the file to the output instead of relying on the build system to do it, but a downside to this is that the project then gets built every time. For a large project this can be a major problem.
Copied from original issue: dotnet/project-system#3216