0

I have a hosted background service in ASP.NET Core, and it coexists with a bunch of web controller APIs.

The background service is registered as a hosted service:

services.AddHostedService<SampleHostedService>();

My front end will poll the web controller APIs at a rate of every 1 second. However, I noticed if I put breakpoints inside the hosted service and step through it in Visual Studio. The web controller APIs no longer respond to the regular poll of front end in a timely manner.

Is there a way to separate the web controller APIs and hosted background service? So that when I debug and step through the background service, the web controller APIs will still respond in a timely manner?

marc_s
760k186 gold badges1.4k silver badges1.5k bronze badges
asked Jun 3 at 14:27
3
  • 1
    I guess you'd need to have the service running in a different process to do that Commented Jun 3 at 14:30
  • Thanks, within Asp.Net Core, if I want to run the background service in a different proces, is there any built in technology with Asp.Net core to support it? Commented Jun 3 at 14:38
  • 1
    I don't think so, you'd have to pick/create some kind of RPC system Commented Jun 3 at 15:15

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.