Last post Apr 12, 2021 06:53 AM by YihuiSun
Apr 07, 2021 03:54 PM|LArmstrong1985|LINK
to transform my asp.net core in a Windows service I use function UseWindowsService() included in Microsoft.Extensions.Hosting.WindowsServices.
All seem to works well when I install it as a service but I noticed a strange problem: if in the appsettings.json there is a single '\' in any point of file, the service not start and return error 1053.
I tried to update to last version of the Microsoft.Extensions.Hosting.WindowsServices (5.0.1) but the problem persists.
Have you ever encountered this type of problem?
The things is that if my service doesn't start due to this problem on the configuration file I can't even log on file.
How can I solve?
Thank you in advance!
Apr 07, 2021 09:40 PM|bruce (sqlwork.com)|LINK
if the app gets a parsing error with appsettings.json it may fail to start or at the return parameter is invalid. as \ is a quote character in json, a single \ is probably an error. you probably want \\
Apr 12, 2021 06:53 AM|YihuiSun|LINK
If you have to use special character in your json string, you can
escape it using \ character.
In the rules of json, you must use
\\ to escape the
backslash every time.