Unhandled Exception: Parameter name: paths when trying to use supervisor on Ubuntu as process monitor
I create a new ASP.Net MVC Core application (2.1.3 sdk) and publish it to my Ubuntu 16.04 server.
Running it with dotnet works but if I try to use supervisor to manage this I get the error below. This is something that works on a quite a few other servers but it seems to be an issue with later versions.
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.UserSecretsConfigurationExtensions.AddUserSecrets(IConfigurationBuilder configuration, String userSecretsId) at Microsoft.Extensions.Configuration.UserSecretsConfigurationExtensions.AddUserSecrets(IConfigurationBuilder configuration, Assembly assembly, Boolean optional) at Microsoft.AspNetCore.WebHost.<>c__DisplayClass8_0.
b__0(WebHostBuilderContext hostingContext, IConfigurationBuilder config) at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors) at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at MyLifeline.Signals.Program.Main(String[] args) in C:__Repos\MyLifeline.Signals\MyLifeline.Signals\Program.cs:line 17
Not sure why supervisor does not work anymore, but anyway, found this article from Microsoft to use systemd instead of supervisor and it worked first time. If you experience the same issue then view this article, super easy to implement.
https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction?tabs=aspnetcore2x