Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio & SubVersion : What about Machine Specific Files

As an example we have a Unit Test Project with an app.config file. The app.config file is configured to work on our build server. But if we want to run our tests locally (with local database) we have to change the app.config...everytime... is there a way to never alter the app.config but to have another file that overrides the app.config configuration? (so that nobody by accident commits a corrupt app.config in subversion?)

(the same off course counts for web.config, ...)

thx, Lieven Cardoen

like image 883
Lieven Cardoen Avatar asked Jul 19 '26 23:07

Lieven Cardoen


2 Answers

Would the 'file' attribute of the appSettings element help? (MSDN)

It allows you to provide a seperate file that can override selected values from the main app.config (or web.config).

like image 126
chyne Avatar answered Jul 22 '26 14:07

chyne


I might be re-inventing the wheel, but you could create multiple app.config files in SubVersion (app.config.release, app.config.debug) then add post build events to copy these files to app.config on developers machines.

I would then avoid putting app.config itself in Subversion at all, you can use app.config.production or similar to store the contents of the file.

like image 41
Richard Slater Avatar answered Jul 22 '26 14:07

Richard Slater



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!