c# - Loading app.config file in Release -


in visual studio 2008 project, i've added app.config file store app-data in xml format.

i read data in code this:

string somedata =    configurationsettings.appsettings["somedatakey"].tostring(); 

when start application in visual studio, works. if try run exe file (release or debug) error (if debuf it breaks on line above):

object reference not set instance of object.

the file app.config not inside folder.

is app.config file in same folder exe? if not, copy there.

starting debugging in visual studio builds everything, , copies output (including app.config) output folder, starting there.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -