Here is my mistake:
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
Startup.cs line 29:
builder.AddUserSecrets();
More code from this file:
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);
builder.AddUserSecrets();
builder.AddEnvironmentVariables();
Configuration = builder.Build();
}
It works fine from the command line, but when I try to start it from the supervisor, I get this error :( Please help.
source
share