Task
I am attempting to allow multiple configuration-based (debug and release) app.config files to propagate to the client via ClickOnce. I am using VB.Net and Visual Studio 2008.
Issue
Based on my current setup, the individual app config files (App.debug.config and App.release.config) get copied to the bin folder correctly during build. However, during publish the resulting App.config file does not appear in the ClickOnce publish directory.
Below is an outline of the current setup I am using. Please assist in determining a best solution.
Steps
The individual configuration files exist within the project as:
- Project
- Configuration (Folder)
- App.debug.config
- App.release.config
- Configuration (Folder)
I have edited the .vbproj file to include the following. This copies and renames the config file into the bin directory.
<Target Name="AfterBuild">
<Delete Files="$(TargetDir)$(TargetFileName).config" />
<Copy SourceFiles="$(ProjectDir)\Configuration\App.$(Configuration).config" DestinationFiles="$(TargetDir)$(TargetFileName).config" />
</Target>
Building succeeds, but when I go to publish there does not exist an instance of the App.config file in the ClickOnce remote directory. My understanding is that ClickOnce is checking the solution folders for content files rather than pulling them from the bin folder.
Is there any way I can either force the publish operation to include a file in the bin folder or pull and rename from the Configuration folder in the same manner as the post build step?