Code:using System.Configuration; using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { String counter = ConfigurationManager.AppSettings["counter"].ToString(); Console.WriteLine(counter); } } }Unhandled Exception: System.NullReferenceException: Object reference not set toCode:<?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="counter" value="15"/> </appSettings> </configuration>
an instance of an object.
I am a bit tired so I quess there is some stupid mistake I am making here but can you help???



LinkBack URL
About LinkBacks


