简体   繁体   English

ArgumentNullException:值不能为空。 参数名称:connectionString

[英]ArgumentNullException: Value cannot be null. Parameter name: connectionString

I've cloned this code from github.我已经从 github 克隆了这段代码。 The code enables to authenticate users against Active Directory.该代码可以根据 Active Directory 对用户进行身份验证。 More here更多在这里

When I run it, it throws the error in the title.当我运行它时,它会在标题中引发错误。 How would you modify the program to have some test DB and be able to trace it?您将如何修改程序以拥有一些测试数据库并能够跟踪它?

You need a value in your config for ConnectionStrings:DefaultConnection .您需要在配置中为ConnectionStrings:DefaultConnection一个值。 It would seem that the confusion is that the GitHub project in question has no appsettings.json , and actually defines this config key in appsettings.github.json , which is not a config file that will be loaded in by default.看起来令人困惑的是,有问题的 GitHub 项目没有appsettings.json ,实际上在appsettings.github.json定义了这个配置键,它不是默认加载的配置文件。 If you rename that file to appsettings.json , that may be enough to fix the issue.如果将该文件重命名为appsettings.json ,则可能足以解决问题。

暂无
暂无

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

相关问题 System.ArgumentNullException:值不能为 null。(参数“connectionString”) - System.ArgumentNullException: Value cannot be null. (Parameter 'connectionString') Asp.Net Core 2.0 ArgumentNullException:值不能为null。 参数名称:connectionString - Asp.Net Core 2.0 ArgumentNullException: Value cannot be null. Parameter name: connectionString 获取连接字符串时出错:ArgumentNullException: Value cannot be null。 参数名称:连接字符串 - Error when get connection string: ArgumentNullException: Value cannot be null. Parameter name: connectionString 值不能为空。 参数名称connectionString - Value cannot be null. Parameter name connectionString System.ArgumentNullException:'值不能为null。 参数名称:键 - System.ArgumentNullException: 'Value cannot be null. Parameter name: key' ArgumentNullException:值不能为null。 参数名称:实体 - ArgumentNullException: Value cannot be null. Parameter name: entity System.ArgumentNullException: '值不能为空。 参数名称:items' - System.ArgumentNullException: 'Value cannot be null. Parameter name: items' System.ArgumentNullException: '值不能是 null。 参数名称:providerInvariantName' - System.ArgumentNullException: 'Value cannot be null. Parameter name: providerInvariantName' ArgumentNullException:值不能为null。 参数名称:包含语句上的键 - ArgumentNullException: Value cannot be null. Parameter name: key on Include Statement ArgumentNullException:值不能为null。参数名称:构造函数 - ArgumentNullException: Value cannot be null. Parameter name: constructor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM