mscorlib.dll中出现“System.ArgumentNullException”类型的异常,但未在用户代码中处理

时间:2016-10-13 13:45:56

标签: c# .net chatbot

当我尝试运行我的应用程序时,我收到此异常

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

Global.asaxcs

中的GlobalConfiguration.Configure(WebApiConfig.Register);文件中

这是代码

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);
        }
    }
}

如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题。 在解决方案资源管理器 - > Web.config。确保AppID& AppSecret不为空。 {

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

}

希望它可以帮到你!

相关问题