When adding an Application Configuration file to a .Net project in Visual Studio it will be named app.config
and will be renamed (on build) to ApplicationName.config
.
I have a solution with about 40 projects. I want to add log4net functionality to quite a few of them. So for every project I would add a file app.log4net
. I would then declare a post-build event like this:
copy $(ProjectDir)app.log4net $(TargetPath).log4net
That works just fine. But I was wondering whether there was a built-in way to achieve the same without an explicit post-build event.
Edit: While I like both solutions proposed by JaredPar and Simon Mourier, they don't provide what I was hoping for. Having a custom tool or MsBuild rule for this makes it less transparent (for other programmers on the project) or at least more complicated than using the post-build event I am currently using. Nevertheless, I feel like MsBuild would be the correct place to solve similar issues.