Cla*_*ith 5 ubuntu asp.net-core
这是我的错误:
Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: paths
at System.IO.Path.Combine(String[] paths)
at Microsoft.Extensions.Configuration.UserSecrets.PathHelper.GetSecretsPathFromSecretsId(String userSecretsId)
at Microsoft.Extensions.Configuration.UserSecrets.PathHelper.GetSecretsPath(IFileProvider provider)
at Microsoft.Extensions.Configuration.ConfigurationExtensions.AddUserSecrets(IConfigurationBuilder configuration)
at WebApplication.Startup..ctor(IHostingEnvironment env) in /root/hackerspulse/Startup.cs:line 29
Run Code Online (Sandbox Code Playgroud)
Startup.cs 第 29 行是这样的:
builder.AddUserSecrets();
Run Code Online (Sandbox Code Playgroud)
该文件中的更多代码:
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
//if (env.IsDevelopment())
//{
// For more details on using the user secret store see https://go.microsoft.com/fwlink/?LinkID=532709
builder.AddUserSecrets();
//}
builder.AddEnvironmentVariables();
Configuration = builder.Build();
}
Run Code Online (Sandbox Code Playgroud)
它从命令行运行良好,但是当我尝试从主管运行它时,出现此错误:(请帮忙。
Mik*_*lev -1
Secret Manager 仅适用于开发时间。请不要在生产环境中使用。
https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets
| 归档时间: |
|
| 查看次数: |
845 次 |
| 最近记录: |