DEV Community

Discussion on: .NET 5 Console App with Dependency Injection, Serilog Logging, and AppSettings

Collapse
 
kvenda profile image
MyProjects

Ugh! I'm such a newbie! My little application works great and picks up all the _config values needed if I run it directly (from cmd line, thru a shortcut, or just double-clicking on the exe). But when I run it from another app (using Process), it interprets the base Directory as the directory of the calling process, and so does not pick up my _config settings from appsettings.json. (I can get the _config info for Logger, because I have the full path hard-coded into builder, but in the rest of the code, the _config data returns null. How to get past this so I can keep my appsettings separate and easily modifiable? Thanks.