System.ArgumentNullException
<p>I am getting this exception...</p>

<pre><code>System.ArgumentNullException: Value cannot be null.
Parameter name: typeName
   at HomeInventory2.Services.Factory.GetService(String servicename) in C:\Users\Protego\Documents\Visual Studio 2010\Projects\HomeInventory2\HomeInventory2\Services\Factory.cs:line 37
   at HomeInventory2.Business.Manager.GetService(String name) in C:\Users\Protego\Documents\Visual Studio 2010\Projects\HomeInventory2\HomeInventory2\Business\Manager.cs:line 14
   at HomeInventory2.Business.InventoryMngr.Create(CreateInventory inv) in C:\Users\Protego\Documents\Visual Studio 2010\Projects\HomeInventory2\HomeInventory2\Business\InventoryMngr.cs:line 19
   at HomeInventory2.Form1.submitButton_Click(Object sender, EventArgs e) in C:\Users\Protego\documents\visual studio 2010\Projects\HomeInventory2\HomeInventory2\Form1.cs:line 52
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message&amp; m)
   at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
   at System.Windows.Forms.Button.WndProc(Message&amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
</code></pre>

<p>Stemming from this code - </p>

<pre><code>private void submitButton_Click(object sender, EventArgs e)
        {
            CreateInventory create = new CreateInventory();
            create.ItemAmount = textBoxAmount.Text;
            create.ItemCategory = textBoxCategories.Text;
            create.ItemProperties = textBoxValue.Text;
            create.ItemValue = textBoxValue.Text;

            InventoryMngr invtryMngr = new InventoryMngr();
            invtryMngr.Create(create);

        }
</code></pre>

<p>That code should end in a file being created with those values being saved to a text file.  Obviously something is breaking down along the line - I am assuming in the InventoryMngr file which looks like this.</p>

<pre><code>namespace HomeInventory2.Business
{
    public class InventoryMngr : Manager
    {
        /// &lt;summary&gt;
        /// persists the inventory information
        /// &lt;/summary&gt;
        /// &lt;param name="inv"&gt;&lt;/param&gt;
        public void Create(CreateInventory inv)
        {
            InventorySvc inventorySvc =
            (InventorySvc)GetService(typeof(InventorySvc).Name);
            inventorySvc.CreateInventory(inv);
        }
    }
}
</code></pre>

<p>The business manager get service</p>

<pre><code>namespace HomeInventory2.Business
{
    public abstract class Manager
    {
        private Factory factory = Factory.GetInstance();
        protected IService GetService(String name)
        {
            return factory.GetService(name);
        }
    }
}
</code></pre>

<p>And the Factory getservice</p>

<pre><code>public IService GetService(string servicename)
{
    Type type;
    Object obj = null;
    try
    {
        type = Type.GetType(GetImplName(servicename));
        obj = Activator.CreateInstance(type);
    }
    catch (Exception e)
    {
        Console.WriteLine("Exception occured: {0}", e);
        throw e;
    }
    return (IService)obj;
}
</code></pre>

<p>GetImplName</p>

<pre><code>private string GetImplName(string servicename)
        {
            NameValueCollection settings =
                ConfigurationManager.AppSettings;
            return settings.Get(servicename);
        }
</code></pre>
