-
I've developed a .NET WebAPI using the dotnet-webapi-starter-kit and Microsoft SQL Server Express. When I start the program manually, it works perfectly. However, when I run it as a scheduled task, it fails to establish the SQL Server database connection and stops. Has anyone experienced this issue? Any advice would be greatly appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Why are you starting it as a scheduled task, and not as a service? I would think that it's a user related issue... are you using a connectionstring with integrated security? Then it's the "current user" that is used, and when you start it as a "scheduled task" then it runs under the system account if I'm not mistaken... |
Beta Was this translation helpful? Give feedback.
I'm attempting to steer clear of relying on outdated IIS. I managed to transition to a Hosted Windows Service instead. However, I'm encountering a setback where the service fails to start during the initialization of the Database service, as illustrated in the screenshot.
Update:
I've successfully debugged and pinpointed the root cause. It turns out that the exception raised by UseFileStorage is due to a missing path.