using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
namespace ConsoleApplication111
{
class Program
{
static void Main(string[] args)
{
String s = ConfigurationManager.AppSettings["Test"];
Int32 foo = Int32.Parse(s);
Console.WriteLine(foo);
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="Test" value="12"/>
</appSettings>
</configuration>
with this code I get a
Unhandled Exception: System.ArgumentNullException: Value cannot be null, Error. The name of the file is appconfig and it is in the same directory as the executable...
Enter your message below
Sign in or Join us (it's free).