简体   繁体   English

mscorlib.dll中发生类型'System.ArgumentNullException'的异常,但未在用户代码中处理

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

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); GlobalConfiguration.Configure(WebApiConfig.Register); Global.asaxcs文件中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? 如何解决呢?

I faced the same problem. 我遇到了同样的问题。 In Solution Explorer -> Web.config . 在解决方案资源管理器-> Web.config中。 Make sure AppID & AppSecret is not null. 确保AppID&AppSecret不为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! 希望对您有帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 mscorlib.dll中发生了类型为&#39;System.ArgumentNullException&#39;的未处理异常附加信息:路径不能为null - An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll Additional information: Path cannot be null 创建 json 文件时,mscorlib.dll 中发生了“System.OutOfMemoryException”类型的异常,但未在用户代码中处理 - An exception of type 'System.OutOfMemoryException' occurred in mscorlib.dll but was not handled in user code, while creating json file mscorlib.dll中发生类型为&#39;System.ArgumentOutOfRangeException&#39;的异常,但未在用户代码中处理 - An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code mscorlib.dll中发生类型&#39;System.Data.SqlClient.SqlException&#39;的异常,但未在用户代码中处理 - An exception of type 'System.Data.SqlClient.SqlException' occurred in mscorlib.dll but was not handled in user code 我不断收到mscorlib.dll中发生的&#39;System.InvalidCastException&#39;类型的异常,但未在RetailPrice的用户代码中处理 - I keep getting An exception of type 'System.InvalidCastException' occurred in mscorlib.dll but was not handled in user code for RetailPrice mscorlib.dll中发生类型&#39;System.UnauthorizedAccessException&#39;的异常,但未在用户代码中处理 - An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code mscorlib.dll 中出现“System.FormatException”类型的异常,但未在用户代码中处理 - An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code mscorlib.dll中发生类型&#39;System.Reflection.TargetInvocationException&#39;的异常,但未在用户代码中处理 - An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll but was not handled in user code mscorlib.dll 中出现“System.Runtime.Serialization.SerializationException”类型的异常,但未在用户代码中处理 - An exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll but was not handled in user code mscorlib.dll中发生类型&#39;System.FormatException&#39;的异常,但未在用户代码中处理 - An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in the user code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM