I'm trying to load serilog configuation from my appconfig.json in ASP.NET Core, but if I publish the application with PublishSingleFile, the application can't load the configuation.
The problem is that, even if I set write to file in the config, the application don't create any log file. But when I disabled publishing single file ( -p:PublishSingleFile=false ), it can load the config file, and create log file as well.
I'm trying to load serilog configuation from my
appconfig.json
in ASP.NET Core, but if I publish the application withPublishSingleFile
, the application can't load the configuation.My
Program.cs
:My
appsettings.json
:The problem is that, even if I set write to file in the config, the application don't create any log file. But when I disabled publishing single file (
-p:PublishSingleFile=false
), it can load the config file, and create log file as well.I tried to print the config section:
It can print
Information
as well, so I think this problem is probably not related to ASP.NET Core.Sorry for my bad English, and I'll be appreciate if anyone can help me!