How to use app.config files in Visual C++ 2005 projects

from Marcus’s Blog

For most Visual Studio .NET language integrations, app.config files are treated specially. Before the target application is started, (with or without a debug session), the language package ensures that the app.config file is automatically copied to the target application’s configuration file. Visual C++ does not have this feature, however it is easy to get the same:

Add a file named app.config to a Visual C++ project and choose the following project settings:

Command line: type app.config > "$(TargetPath).config"

Description: "Updating target’s configuration file"

Outputs: "(TargetPath).config"

Notice that the file is copied via the command type and piping. I prefer this to using the copy command here, because this command ensures that the date of the compiled file is automatically adapted whenever the file is copied.

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: