Results 1 to 4 of 4

Thread: [RESOLVED] Reading app.config

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667

    Resolved [RESOLVED] Reading app.config

    HI all using the following code.

    Code:
    //Should just bring back my name from a config file
    try
    	{							
    		string x =ConfigurationSettings.AppSettings["name"].ToString();
    		MessageBox.Show(x.ToString());
    	}
    	catch(ConfigurationException ce)
    	{
    		MessageBox.Show(ce.Message);
    	}
    	catch(Exception ge)
           {
    	       MessageBox.Show(ge.Message);
    	}
    Works fine in the IDE but when i run the release version I get the following exception message.

    Object reference not set to an instance of an object
    ANy help would be greatly appreciated!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width