0

When I am trying to run my application I am getting this exception

An exception of type 'System.ArgumentNullException' occurred in mscorlib.dll but was not handled in user code

In Global.asaxcs file in GlobalConfiguration.Configure(WebApiConfig.Register); line

Here is the code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;

namespace Bot_Application2_test
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
    }
}

How to solve this?

Pooja Dutta
  • 11
  • 1
  • 2
  • add check for null before this line – vivek nuna Oct 13 '16 at 13:48
  • Possible duplicate of [What is a NullReferenceException, and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Izzy Oct 13 '16 at 13:52

1 Answers1

1

I faced the same problem. In Solution Explorer -> Web.config . Make sure AppID & AppSecret is not null. {

 <appSettings>
    <!-- update these with your appid and one of your appsecret keys-->
    <add key="AppId" value="YourAppId" />
    <add key="AppSecret" value="YourAppSecret" />
  </appSettings> 

}

Hope it helps you!

user2092402
  • 115
  • 9